Hi, I'm using Javascript, ASP.net and c#. I want to write a custom control to check if javascript is enabled on the browser and display a message. I'm using the following approach: -the control shows a message "Javascript disable" in a tag -the control adds in the section a javascript section with this line:
window.onload = function() {{document.getElementById('My_MESSAGE_DIV').style.display = 'none';}}
The problem is the following: when Javascipt is enabled the onload event is fired when the page is already displayed so the message "Javascript disable" appears on the page and disappear immediately, I would like to avoid this! Any suggestion?
Possible solution: - find an event that get fired before the document is displayed. Any suggestions?