Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need an example for a JavaScript Function

Status
Not open for further replies.

subhavs

Programmer
Nov 27, 2000
54
US
Hi,

I intend to use some JavaScript functions repeatedly in several JSPs.

I tried to put the functions in a separate JavaScript file and then call these functions from the individual JSPs (using the <SCRIPT LANGUAGE=&quot;javascript&quot; SRC=&quot;someFile.js&quot;>).

The browser does not recognise this. I don't understand where I am going wrong. If somebody can provide me with a working example, I would really appreciate it.

Thanks,

- Subha :) Nothing is impossible, even the word impossible says I'm possible.
 
What errors do you get with using the <SCRIPT SRC=> tag? You can't use JavaScript to manipulate JSP variables, if that's what you're trying to do. Otherwise give us some more info on what the problem is - what's the function do? Source code? Error msg's?

Thanks,

Tim --
Tim <tim@planetedge.co.uk>
 
Thanks for the quick response, Tim.

I finally figured out what the problem was - </SCRIPT> tag was placed at the end of the JSP file. Inbetween I had lots of other HTML tags, so the compiler was treating all of these as Javascript as well. DUUUH !!!

I am new at this, so I am learning it the hard way. Thanks for the time :)

- Subha Nothing is impossible, even the word impossible says I'm possible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top