Home › Forums › JavaScript › Fallback on Local jQuery If CDN Fails is ok but how to control de time to wait? › Re: Fallback on Local jQuery If CDN Fails is ok but how to control de time to wait?
November 16, 2012 at 5:57 pm
#114591
JohnMotylJr
Participant
@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)