How to detect if JavaScript is disabled?

后端 未结 30 3380
暗喜
暗喜 2020-11-21 07:37

There was a post this morning asking about how many people disable JavaScript. Then I began to wonder what techniques might be used to determine if the user has it disabled.

30条回答
  •  情歌与酒
    2020-11-21 08:10

    You can use a simple JS snippet to set the value of a hidden field. When posted back you know if JS was enabled or not.

    Or you can try to open a popup window that you close rapidly (but that might be visible).

    Also you have the NOSCRIPT tag that you can use to show text for browsers with JS disabled.

提交回复
热议问题