File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes linking to external js Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "linking to external js" Watch "linking to external js" New topic

linking to external js

subhanair girish

Joined: Aug 12, 2008
Posts: 13
I tried to write all my javascripts in an external js file.

But I am unable to make it work.

<script language="JavaScript" type="text/javascript" src="validation.js">


This is how I have written in my jsp page.

please help...
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1599
Originally posted by subhanair girish:

But I am unable to make it work.

what did you do & what is happening? where is your jsp and where is your js. Check your folder-structures and paths.

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

how did you test your js validation file?

please use Javascript Console in Firefox in case of error enquiry.

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

It's likely that your page-relative URL is failing. Please see the JSP FAQ on resource URLs to see how to properly reference external resources in a JSP.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: linking to external js
jQuery in Action, 3rd edition