Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript SRC path not working
    primarykey
    data
    text
    <p>I have searched this web looking for an answer, but it seems that this time I'm not so lucky, so I am forced to ask. I apologize if it's already answered (could not find it). And yes, English is not my first language, so I also apologize for my spelling mistakes, I try my best.</p> <p>This is my problem, using Tomcat 5.5, Struts 1.3, JRE 1.5 and I'm using firefox 3.5.6. In my jsp page I cannot seem to put any <code>src="path/path"</code> in my <code>&lt;script&gt;</code> I have tried deleting the src and all works well, but my project is going to need a lot of use from jquery and I do not want to copy/paste all the js file in every jsp.</p> <p>This is my code:</p> <pre><code>&lt;script type="text/javascript" src="js/jquery-1.3.2.js"&gt; function showMySelf(){ alert("Hello World!"); } (... plus other stuff code that actually uses jquery functions) &lt;/script&gt; </code></pre> <p>and the submit button:</p> <pre><code>&lt;input type="submit" onclick="showMySelf()"&gt; </code></pre> <p>When I click the button, nothing happens (well it actually repaints the page) and when I delete the "src" tag from the script and add all the jquery code to the page it all works well. </p> <p>I have tried putting another slash in the path as "/js/jquery-1.3.2.js" and returns an error. </p> <p>I have tried using ResolveURL and it doesn't seem to give me better results.</p> <p>I have also tried changing the js file to another file ("generics.js" and "js.js"), I also tried with "js/*.js". </p> <p>Any of theese solutions have archived anything.</p> <p>I have also tried using the struts tags (like html:submit) but it also did not work.</p> <p>The path is actually right, since looking the code in my web browser gives me a link to the js file. So I suposse the browser knows were to look for my js file, it does not give me an error or a broken link to the file.</p> <p>Any ideas of why this is happening?</p> <p>Thank you all.</p> <p>Random.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload