Nella logica evento ready jQuery:Perché jQuery fuoco l'evento ready in modo asincrono
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if (document.readyState === "complete") {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout(jQuery.ready, 1);
}
Potrebbe spiegare il commento: "Gestire in modo asincrono per consentire gli script l'opportunità di ritardare pronto".
Non capisco cosa script e perché ritardare pronto?
Mi sono posto la stessa domanda un paio di volte. – gdoron
Anche per me è molto interessante – johnny
Sembra che questo sia correlato a IE _siamo qui perché readyState === "completo" in oldIE che è abbastanza buono per poter chiamare dom ready! _ Http: // bugs. jquery.com/ticket/12282#comment:15 – undefined