How to detect if JavaScript is disabled?

后端 未结 30 3474
暗喜
暗喜 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条回答
  •  旧时难觅i
    2020-11-21 08:08

    To force users to enable JavaScripts, I set 'href' attribute of each link to the same document, which notifies user to enable JavaScripts or download Firefox (if they don't know how to enable JavaScripts). I stored actual link url to the 'name' attribute of links and defined a global onclick event that reads 'name' attribute and redirects the page there.

    This works well for my user-base, though a bit fascist ;).

提交回复
热议问题