> I would also recommend you evaluate the SRC attribute of the <SCRIPT> tag.
I
> have always found it better to farm out my scripts to a separate .js file.
> Of course, you do need to download the file when the page loads but this
is
> more than offset by the following facts
This is not necessarily a good idea. Netscape is known to freak out from
time to time if you put your js (or anything for that matter) in an external
file.
> - it is harder for your users to view your scripts since there are not
part
> of your page source
Not a good reason. First, it's nice to share your knowledge with those who
don't know, and second, if you want to access the js it's no problem anyway.
> - you don't clutter your JSP with a lot of scripting. You just need the
bare
> minimum (event handler source points and the like)
In many cases the js-code isn't very long, but if it is, I agree that it can
be convenient to source it.
> - if you load the script file in all your JSPs, you can declare and
maintain
> global script variables. (remember that your scripts and script variables
> are wiped out as your users move from page to page).
I'm not sure if I understand what you mean. If you go to another page, all
the js variables will be lost--regardless if you have the exact same scripts
on that page. To keep variables between pages, the session object is the
obvious answer.
Regards,
Tommy Enqvist
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets