Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3407460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:45:14+00:00 2026-05-18T05:45:14+00:00

I read http://ajaxpatterns.org/On-Demand_Javascript and got interested in lazy loading my JS. Questions: Can anyone

  • 0

I read http://ajaxpatterns.org/On-Demand_Javascript and got interested in “lazy loading” my JS. Questions:

  1. Can anyone recommend a good plugin for this?
  2. Any “real world” advice implementing such a strategy? Any “gotchas” I should look out for?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:45:14+00:00Added an answer on May 18, 2026 at 5:45 am

    No plugin needed. You can use jQuery’s $.getScript(). Just put a particular event’s javascript in a separate file, then bind an event that calls $.getScript().

    $(function() {
        $('#yourElement').click(function() {
            $.getScript('/path/to/script.js');
        });
    });
    

    This will ensure that you never load more javascript than you need to. If the user never clicks on the element, you never loaded the javascript for the event. There will be a small delay for the HTTP request, so you should probably indicate a loading animation on click while the script loads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I google'd a bit and read http://en.wikipedia.org/wiki/Portable_Executable but i can't seem to find when
I wrote a component for Joomla!.I Read http://docs.joomla.org/Publishing_to_JED . but i can't find submit
I have a question about the C++ visibility attribute. I have read http://gcc.gnu.org/wiki/Visibility and
Preface: Yes, I've read: http://drupal.org/node/547518 I am writing 'foo' module for Drupal6, where I
So, here is the discussion I have just read: http://www.mail-archive.com/delphi@delphi.org.nz/msg02315.html BeginUpdate and EndUpdate is
I've read http://www.json-p.org/ which states a safer and stricter subset of JSON-P. The most
how can we read http port in c#
I've read http://wxpython.org/docs/api/wx.ConfigBase-class.html I've done some basic things like the appended. What I can
I've read: http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#the-accesskey-attribute and it doesn't say anywhere if or how the 'Home' key
I read 'http://gitready.com/intermediate/2009/02/13/list-remote-branches.html' . I am using git 1.6.3.3. My question is how can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.