I am trying to make alert box after page reloaded, but it doesn\'t work.
Please correct my code and tell me why?
$(\"button\").click(function(){
wind
That's called onload. It came waaaaay before DOM ready was around, and DOM ready was actually created for the exact reason that onload waited on images.
window.onload = function () {
alert("It's loaded!");
//dom not only ready, but everything is loaded
}
And a jQuery Javascript solution is to bind the window.onload event in document.ready().
$(window).bind("load", function() {
// code here
});