aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "problem with accessing a JS file" Watch "problem with accessing a JS file" New topic
Author

problem with accessing a JS file

Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
Friends,
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"
SRC="../js/SpellCheckForm.js"></SCRIPT>

<SCRIPT LANGUAGE="JavaScript1.1"
SRC="/js/SpellCheckForm.js"></SCRIPT>

<SCRIPT LANGUAGE="JavaScript1.1"
SRC="<%=request.getContextPath()%>/js/SpellCheckForm.js"></SCRIPT>

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:
-webContent
----JSP
----JS

Regards,
Leena


[SCJP2, SCWCD1.3, SCBCD]
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

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..


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

Joined: Jan 10, 2002
Posts: 61433
    
  67

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] [Bear's FrontMan] [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?

Herman
sreekanth nair
Greenhorn

Joined: Mar 12, 2007
Posts: 20
don't put relative src put absolute means with out ../
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with accessing a JS file