• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

problem with accessing a JS file

 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Leena,

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

Herman
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
don't put relative src put absolute means with out ../
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic