jQuery – Waiting for the document to load

Running javascript after DOM is loaded

1
2
3
4
5
$(document).ready(function() {

alert('loaded!');

});

or…

1
$(function() { alert('hello'); });