This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with accessing a JS file  RSS feed

 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Leena,

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

Herman
 
sreekanth nair
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't put relative src put absolute means with out ../
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!