File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes problem with accessing a JS file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem with accessing a JS file" Watch "problem with accessing a JS file" New topic

problem with accessing a JS file

Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
Im having problem with accessing a JS file placed in another folder from a JSP popup.

I tried all the following:
<SCRIPT LANGUAGE="JavaScript1.1"

<SCRIPT LANGUAGE="JavaScript1.1"

<SCRIPT LANGUAGE="JavaScript1.1"

No options worked.

I am accessing files this way in other JSP files.

Not sure what can be the issue in one particular case?? Any pointers to debug?

the folder structure is as follows:


Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1323

have you receive any error by running this.. check your JavaSCript console inside of tool menu on FireFox.

I think you don't need to define a version inside a Language. It just what I am thinking! not sure about it.. Can someone clear me on that..

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

Joined: Jan 10, 2002
Posts: 63866

Using page-relative addressing can be a problem in wab apps. It is recommened to use server-relative addressing as in your 3rd example.

Where does the file actually reside in relation to the context root?
[ March 23, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Leena,

-is it JS or js?
-did you check the generated HTML in your popup?

sreekanth nair

Joined: Mar 12, 2007
Posts: 20
don't put relative src put absolute means with out ../
I agree. Here's the link:
subject: problem with accessing a JS file
It's not a secret anymore!