My client wishes to show an alert when entering a web page.
However, an alert blocks further loading of the page until "Ok" is clicked, and the page needs to load in the background while the alert is displayed.
One solution would be to use a custom alert using HTML and CSS, but this is not answering the client's needs.
Is there a solution using 'core javascript' or jQuery to allow the page to load while the alert is displayed? Thanks.
You should run it through a setTimeout:
setTimeout(function() { alert('hello world'); }, 1);
This is shown here: Is there a JavaScript alert that doesn't pause the script?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With