Re: [seattlejs] Delaying loading of scripts for faster page loads

From: Thomas W.
Sent on: Thursday, May 10, 2012 12:20 PM
IGNORE THIS I AM WRONG.

Turns out you can load arbitrary stuff with RequireJS. I'm not sure how
well it would work for things like Disqus that are going to write out
using document.write, though. Probably not very well.

> No, it's only AMD. You can use the require optimizer to package arbitrary
> scripts as AMD, but only if you own them--it doesn't work for 3rd party
> stuff on remote servers.
>
>> Does RequireJs handle arbitrary scripts? I had the (probably false)
>> impression that it was only AMD.
>>
>> On Thu, May 10, 2012 at 11:47 AM, Jeff Lembeck  wrote:
>>  I tend to use require.js for handling modular loading.
>>
>>  It's really fanastic for the purpose of handling dependencies as
>> well.
>>
>>  http://requirejs....­
>>
>>
>>
>>  On Thu, May 10, 2012 at 11:33 AM, Tony Bentley  wrote:
>>  > To answer question #1, I've had great success with head.js for
>> controlling blocking and non-blocking JS resource loading.
>>  >
>>  > -Tony
>>  >
>>  >
>>  >
>>  > On May 10, 2012, at 10:44 AM, Jennifer Simonds wrote:
>>  >
>>  >> I was struggling with 3rd-party page widgets that immediately load
>> in
>>  >> JavaScript files, thus slowing down the page load. Disqus was the
>> real
>>  >> killer for me - it loads in around a dozen scripts & css files!
>> Some of my
>>  >> pages rely on AJAX to initialize the page's contents, so they
>> became
>>  >> embarrassingly slow to load.
>>  >>
>>  >> So I wrote a class, LateLoad.js, that makes it easy to delay loading
>>  >> external scripts until window.onload, $(document).ready, a fixed
>> timeout, or
>>  >> when you explicitly tell it it's OK to load. It works like a
>> champ
>> on all
>>  >> but one of the few widgets I've used it for.
>>  >>
>>  >> http://www.atomic...­
>>   >>
>>  >> I have 2 questions:
>>  >>
>>  >> 1. I've seen scattered blog & StackOverflow posts on this
>> subject, & Steve
>>  >> Souders writes at length about some techniques to use, but is there
>> a
>> class
>>  >> or library that "everyone"­ already uses to accomplish
>> this?
>> If I'm
>>  >> reinventing some wheel that everyone already uses & is happy
>> with,
>> it might
>>  >> not be worth it for me to push this out there on the world.
>>  >>
>>  >> 2. If you try LateLoad, could you please report back your results -
>> good or
>>  >> bad - in the comments on my site so I can build up a compatibility
>> list? The
>>  >> results would drive future development.
>>  >>
>>  >> Thanks!
>>  >> Jenny Simonds
>>  >> W. Seattle
>>  >>
>>  >>
>>  >>
>>  >>
>>  >>
>>  >> --
>>  >> Please Note: If you hit "REPLY"­, your message will be sent
>> to everyone on this mailing list ([address removed])
>>  >> http://www.meetup...­
>>  >> This message was sent by Jennifer Simonds ([address removed])
>> from Seattle JS.
>>  >> To learn more about Jennifer Simonds, visit his/her member profile:
>> http://www.meetup...­
>>  >> Set my mailing list to email me
>>  >>
>>  >> As they are sent
>>  >> http://www.meetup...­
>>  >>
>>  >> In one daily email
>>  >> http://www.meetup...­
>>  >>
>>  >> Don't send me mailing list messages
>>  >> http://www.meetup...­
>>  >> Meetup, PO Box 4668 #37895 New York, New York 10163-4668 |
>> [address removed]
>>  >>
>>  >
>>  >
>>  >
>>  >
>>  > --
>>  > Please Note: If you hit "REPLY"­, your message will be sent
>> to
>> everyone on this mailing list ([address removed])
>>  > http://www.meetup...­
>>  > This message was sent by Tony Bentley ([address removed]) from
>> Seattle JS.
>>  > To learn more about Tony Bentley, visit his/her member profile:
>> http://www.meetup...­
>>  > Set my mailing list to email me
>>  >
>>  > As they are sent
>>  > http://www.meetup...­
>>  >
>>  > In one daily email
>>  > http://www.meetup...­
>>  >
>>  > Don't send me mailing list messages
>>  > http://www.meetup...­
>>  > Meetup, PO Box 4668 #37895 New York, New York 10163-4668 |
>> [address removed]
>>  >
>>
>>
>>
>>
>>  --
>>  Please Note: If you hit "REPLY"­, your message will be sent to
>> everyone on this mailing list ([address removed])
>>  http://www.meetup...­
>>  This message was sent by Jeff Lembeck ([address removed]) from Seattle
>> JS.
>>  To learn more about Jeff Lembeck, visit his/her member profile:
>> http://www.meetup...­
>>  Set my mailing list to email me
>>
>>  As they are sent
>>  http://www.meetup...­
>>
>>  In one daily email
>>  http://www.meetup...­
>>
>>  Don't send me mailing list messages
>>  http://www.meetup...­
>>  Meetup, PO Box 4668 #37895 New York, New York 10163-4668 |
>> [address removed]
>>
>>
>>
>>
>>
>>
>>  --
>>  Please Note: If you hit "REPLY", your message will be sent to everyone
>> on
>> this mailing list ([address removed])
>>  This message was sent by Christopher ([address removed]) from
>> Seattle JS.
>>  To learn more about Christopher, visit his/her member profile
>>  Set my mailing list to email me As they are sent | In one daily email |
>> Don't send me mailing list messages
>>
>>   		Meetup, PO Box 4668 #37895 New York, New York 10163-4668 |
>> [address removed]
>
>
>
>
>
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on
> this mailing list ([address removed])
> http://www.meetup...­
> This message was sent by Thomas Wilburn ([address removed]) from
> Seattle JS.
> To learn more about Thomas Wilburn, visit his/her member profile:
> http://www.meetup...­
> Set my mailing list to email me
>
> As they are sent
> http://www.meetup...­
>
> In one daily email
> http://www.meetup...­
>
> Don't send me mailing list messages
> http://www.meetup...­
> Meetup, PO Box 4668 #37895 New York, New York 10163-4668 |
> [address removed]
>
>

Our Sponsors

  • Twilio

    Get an extra $30 of credit when your upgrade! Use the code: SeattleJS01

  • Formidable Labs

    We build large scale web apps for the enterprise and startups alike.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy