This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes how to run js file with apache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to run js file with apache" Watch "how to run js file with apache" New topic

how to run js file with apache

Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87

I have written some code in javascript file.. and accessing this file through <script src=""> tag in html.. but its not working when I deploy it on apache server.

but when I write same code in html file withing <scritpt> tag its working perfectly. so is there any configuration I have to do on apache server for working with js files. (I am using apache server.. not apache tomcat)


SCJP 6 (88%), SCWCD 5 (78%), preparing for SCBCD
David Newton

Joined: Sep 29, 2008
Posts: 12617

Is the file being served?
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
Special settiongs are not required, just check as the guru said - if the file's being served. The path in "src" could be the culprit.

Experience and talent are independent of age
Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
yes the file is serving.. cause its showing the other contents other than script tag includes.

and I dont thing the src could be culprit.. coz If I open same individual html.. not on server.. but simply double clicking on html file.. its giving me the correct results.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63202

Saurabh Naik wrote: coz If I open same individual html

Please use real words when posting to the forums. Abbreviations such as "coz" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

JavaRanch sheriff

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: how to run js file with apache
It's not a secret anymore!