you have to refer to your .js file by the absolute path.

i.e., if your script file is MyScript.js and is under the /emp directory
under the document root, the
html tag would be
<script .. src="/emp/MyScrip.js">

The thing to be noted is that for servlets and jsp, the complete path has to
be specified. Whereas for
html pages we can specify the relative path.

BTW, Netscape 4 will show a 404 error if it cannot find the .js file. IE
will ignore it but will give JavaScript errors.

And one useful tool for debugging JavaScript is the Netscape JavaScript
debugger. It saved me lots of time and effort.
If you are writing lots of JavaScript then it is a must.

Regards
Nagaraj.




-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Manish Bhatnagar
Sent: Wednesday, November 29, 2000 9:45 AM
To: [EMAIL PROTECTED]
Subject: Where to put .js file...


Hi!
>From a servlet I am generating an HTML page. For validating the page...
I am using JavaScript. Where do I put the .js file in my Web server. I
am using Java Web Server 2.0 on Windows 98.
Thanx in advance,
Manish

--
+----------------------------------------------Live-Your-Dream----+
Obstacles are things a person sees when he takes his eyes off his goal.

-E. Joseph Cossman

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to