开发者

checking javascript is enabled

开发者 https://www.devze.com 2023-02-07 04:33 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消