Reputation: 389
I am trying to use jquery to open a popup on Pageload. I guess this is what i should use to show the popup after a button click in an Asp.Net application. How do i get the popup on Pageload.
$(document).ready(function(){
$("#button").click(function(){
centerPopup();
loadPopup();
});
});
Thank you in advance!!
Upvotes: 1
Views: 662
Reputation: 69905
Just trigger the button click handler if you want to use the same code to load the popup on page load.
$(document).ready(function(){
$("#button").click(function(){
centerPopup();
loadPopup();
}).click();
});
Upvotes: 1
Reputation: 8767
You can make it popup on the ready function:
$(document).ready(function(){
centerPopup();
loadPopup();
});
Upvotes: 1
Reputation: 21860
Just remove the click handler:
$(document).ready(function(){
centerPopup();
loadPopup();
});
Upvotes: 1