Jump to content

"lazy-loading" technique for JS apps


Adam

Recommended Posts

http://www.stevesouders.com/blog/2009/09/26/mobile-gmail-and-async-script-loading/

 

…we wrote each module into a separate script tag and hid the code inside a comment block (/* */). When the resource first loads, none of the code is parsed since it is commented out. To load a module, find the DOM element for the corresponding script tag, strip out the comment block, and eval() the code.
Link to comment
https://forums.phpfreaks.com/topic/175904-lazy-loading-technique-for-js-apps/
Share on other sites

I think that lazy load is the bad term, not the good one:

 

 

Loading JavaScript in the background does indeed freeze the UI and lockout the user. Even worse, they don’t know why this is happening. They didn’t invoke any action - the lazy-load was kicked off in the background.

 

 

Assuming your title was implying that lazy-loading was the cool new thing.

 

Looks awesome though. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.