Tommy:
Thanks for your comments.
My rebuttals tagged with *** |-)
-----Original Message-----
From: Tommy Enqvist [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 23, 2000 2:46 AM
To: [EMAIL PROTECTED]
Subject: Re: How to combine javascipt within JSP ?
> 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.
*** OK. I did not know that. Our script is aimed at DOM1. So, I hope those
problems will be fiexed in NS 6.0.
> - 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.
*** OK. Everything seems to be so concerned with users not being able to do
this or that. I personally do not care one way or another.
> - 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.
*** We will eventually have some large client script files as we envision
our app as having a medium smart client, sort of half way between a fat
client and a pure HTML ultra thin one.
> - 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.
*** What I mean by that is as follows:
If all JSPs have script tag pointing to the same .js file, than all
global object variables will be loaded in all of them and they will all
start with the same defaults. Also, even if I do see the need for keeping
session variables on the server, these are not directly available to
javascript and they also be meaningless for client processing (as in default
state for page elements and whatnot), so we like to maintain client-wide
states in the script.
Regards
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
===========================================================================
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