Daniel Green wrote:
>> Is there an easy way to make this download as a separate .js file
>> instead of inline? Or to suppress it if I'm not using AJAX at all?
>>
> Having it inline decreases the number of requests the browser must make.

True. But that's one hit and then it's cached. Putting it in the HTML 
not only mixes the two (which I prefer to avoid when possible), but 
forces the user to re-download that script on every page, even when 
there's no AJAX on the page.

Actually, what I prefer is to have no JS at all in my HTML code (and 
that includes event handlers). I'd rather link to a script and have the 
script use the DOM to assign the event handlers to the code. Then if the 
script isn't downloaded for any reason, the code is nice and clean.

And multiple JS scripts (or CSS stylesheets) could be gzipped up 
dynamically by Lift into a single gz file and served that way -- much 
faster -- you only have the single latency.

Chas.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to