checking javascript is enabled
I am building a html page. I was to make a quick 1 line test which, if the user has javascript enabled says "javascript on" oth开发者_Go百科erwise says "javascript off" just to let them know.
How can I do this?
<div id="js_onoff">JavaScript off :(</div>
<script>
document.getElementById("js_onoff").innerHTML = "JavaScript on, yeah! :)";
</script>
<script type="text/javascript">document.write('JavaScript On');</script>
<noscript>JavaScript Off</noscript>
Maybe?
There are going to be a lot of options here.
精彩评论