简体   繁体   English

在浏览器事件处理程序中禁用 javascript

[英]Disable javascript in browser event handler

Is there an event handler for when user disables javascript in their browser, ideally something that could be implemented in/as Google Chrome plugin?当用户在浏览器中禁用 javascript 时,是否有事件处理程序,理想情况下可以在/作为 Google Chrome 插件实现?

In my case, I'd like to redirect user to new page if they were to disable javascript in their browsers.就我而言,如果他们要在浏览器中禁用 javascript,我想用户重定向到新页面。

You can put a <meta> tag inside a <noscript> block:您可以将<meta>标签放在<noscript>块中:

<noscript>
  <meta http-equiv="refresh" content="0; url=http://your.url.com/">
</noscript>

Put that in the <head> somewhere, close to the top because some older browsers were touchy about <meta> tags sometimes (maybe not a refresh tag).把它放在<head>某个地方,靠近顶部,因为一些旧的浏览器有时对<meta>标签很敏感(可能不是刷新标签)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM