Reputation: 29
I have a script that invoke pageLoad after all content is loaded.
I need it to be on before page load
my script is
function pageLoad()
{
$('#myModal1').modal('show');
}
window.onload = pageLoad;
Can anyone do anything this script to get show on before load page?
Thanks very much
Upvotes: 0
Views: 3350
Reputation: 3350
The onreadystatechange
event is fired on a HTML document when the load state of the page's content has changed.
document.onreadystatechange = function()
{
console.log(document.readyState);
if (document.readyState === 'complete')
{
console.log("onbefore")
}
};
window.onload = function(e)
{
console.log("onload");
};
Upvotes: 2