Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Re (tilly) 1: Compressing/Obfuscating a Javascript file

by mischief (Hermit)
on Oct 07, 2001 at 23:27 UTC ( #117335=note: print w/replies, xml ) Need Help??


in reply to Re: Re (tilly) 1: Compressing/Obfuscating a Javascript file
in thread Compressing/Obfuscating a Javascript file

Perhaps you could get around this by using SSIs to include the javascript libs in the data sent to the browser rather than "<script src=...">? That would also speed up loading (although only marginally, but you did say modem, didn't you? :-) times as it would reduce the number of requests the browser has to send, so less headers send & received and less delays connecting.

Replies are listed 'Best First'.
Re: Re: Re: Re (tilly) 1: Compressing/Obfuscating a Javascript file
by andreychek (Parson) on Oct 08, 2001 at 01:03 UTC
    Well, thats an excellent point.. and if SSIs wouldn't do, I could always use something like HTML::Template's TMPL_INCLUDE system to do the same thing.

    However, there is an advantage to using the <script src=...> -- When you use it, you are allowed to include a host other then the one the original HTML file was loaded from. So if you're browser requests
    http://www.foo.com/pizza.html

    pizza.html can contain the line:
    <script src="http://www.bar.com/pepperoni.js">
    And thats actually legal. Now, it maybe possible to do something similar with SSI. However, you could use those script lines to load JavaScript after the original document had been loaded.. dynamicly choosing which document to load. Lets say, in our pizza example, that the user has three buttons -- one labeled pepperoni, one sausage, and one pinapples. By clicking one of them, you can use a hidden frame to have the browser go out and grab that JavaScript file -- whatever site it may be on, without making the browser reload any content.

    I hope that made sense :-) I have a project that makes use of this sort of thing, called OpenThought. It's all about delivering content to a web browser without making the pages reload. The code will be in CVS within a day, and you can read the current documentation at the website.
    -Eric

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://117335]
help
Chatterbox?
[atcroft]: (And Feb. is the odd case, because it is 28, unless it is a year divisible by 4, or if it is divisible by both 100 and 400 (at which point it is 29).)
[james28909]: i know but scroll through your calendar on your computer.
[james28909]: i thiught you were going to say make both hands into a fist and puch yourself in the face
[atcroft]: .oO(Sorry, I probably should have said take two normal hands....)
[atcroft]: james28909: No, unless you are a politician, I wouldn't say that (and even if you are, I still probably wouldn't say that).
[james28909]: i mean how hard can it be? its just subtracting days lol
[atcroft]: james28909: What about October 5, 1582?
[stevieb]: atcroft: "Make both hands into fists..."... is something my Ma taught me in our native lang, but I was to ignorant and young to pay attention. Thanks for that :)
[atcroft]: stevieb: Sad to say that I only recently learned that particular trick, but I have since found it very useful.... :)
[james28909]: ill be back with a solution eventually

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2017-04-29 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.