Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 537127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:53:38+00:00 2026-05-13T09:53:38+00:00

I have searched this web looking for an answer, but it seems that this

  • 0

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.

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 src="path/path" in my <script> 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.

This is my code:

<script type="text/javascript" src="js/jquery-1.3.2.js">
    function showMySelf(){
        alert("Hello World!");      
    }
(... plus other stuff code that actually uses jquery functions)
</script>

and the submit button:

<input type="submit" onclick="showMySelf()">

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.

I have tried putting another slash in the path as “/js/jquery-1.3.2.js” and returns an error.

I have tried using ResolveURL and it doesn’t seem to give me better results.

I have also tried changing the js file to another file (“generics.js” and “js.js”), I also tried with “js/*.js”.

Any of theese solutions have archived anything.

I have also tried using the struts tags (like html:submit) but it also did not work.

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.

Any ideas of why this is happening?

Thank you all.

Random.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:53:38+00:00Added an answer on May 13, 2026 at 9:53 am

    You can not use a script element to load an external file and put code in it at the same time. You need to use two script elements:

    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        function showMySelf(){
            alert("Hello World!");      
        }
    (... plus other stuff code that actually uses jquery functions)
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Windows Forms, VB. I have searched the web for the correct answer to this
So I have searched for this but not finding anything about it and if
Not a great title but I'm looking more for some guidance, have searched quite
I have searched but not found exactly what I was looking for. I have
I have searched all over the web with no luck of making this project
Preface: I am sure this is incredibly simple, but I have searched this site
I have searched for this, and i found that for api less than 12,
I have searched and searched for this but I think my terminology isn't correct
I have searched for this for a long time now... I am writing an
I have searched for this but nobody have the same issue.. Now I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.