How to detect if JavaScript is disabled?

后端 未结 30 3430
暗喜
暗喜 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 07:56

    You might, for instance, use something like document.location = 'java_page.html' to redirect the browser to a new, script-laden page. Failure to redirect implies that JavaScript is unavailable, in which case you can either resort to CGI ro utines or insert appropriate code between the tags. (NOTE: NOSCRIPT is only available in Netscape Navigator 3.0 and up.)

    credit http://www.intranetjournal.com/faqs/jsfaq/how12.html

提交回复
热议问题