“document.ready ()” Código de respuesta

Dom Ready JS

document.addEventListener("DOMContentLoaded", function() {
  // code
});
Joyous Jaguar

Abajo para el documento jQuery listo

$(function(){ 
	//jQuery code here 
});
Southern Boubou

documento.

// A document ready block with JQery.
$( document ).ready(function() {
    // we ready for fire action with JQery.
});


// A document ready block with javascript.
document.addEventListener("DOMContentLoaded", function(event) { 
  // we ready for fire action with javascript.
});
Nilesh

Documento JS listo

// Pure JS document ready ...
document.addEventListener('DOMContentLoaded', (event) => {
  //the event occurred
})
ElHok

document.ready ()

document.addEventListener("DOMContentLoaded", function(event) { 
  //we ready baby
});
Grepper

JS listo

// without jQuery (doesn't work in older IEs)
document.addEventListener('DOMContentLoaded', function(){ 
    // your code goes here
}, false);
Bullyard

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código