Grow your CSS skills. Land your dream job.

Fallback on Local jQuery If CDN Fails is ok but how to control de time to wait?

  • # November 16, 2012 at 4:43 pm

    Fallback on Local jQuery If CDN Fails is ok, but how to control the time to wait? How much should we wait before download the local copy of jQuery?

    # November 16, 2012 at 5:57 pm

    @nagarweb
    I would say immediately, because calling the jQuery’s CDN version is a http request, so if it comes back bad (404), its going to move on to loading the next resource.

    If for some reason you DO? want to wait you could add

    < script src="whatever.js" defer>< /script >

    or for some reason delay loading a script until something else happens, or by a timer.

    defer: Specifies that the script is executed when the page has finished parsing (only for external scripts)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".