noscript标签不工作在互联网浏览器 [英] noscript tag isn't working on internet explorer

查看:126
本文介绍了noscript标签不工作在互联网浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站与< noscript> 标签,除了IE(7,8,9,10)之外的所有浏览器都可以正常工作。
在禁用Internet选项内的安全设置下的脚本后,在我的电脑上,我可以在IE上的< noscript> 内容,但在其他PC几乎所有的人)我看不到代码。使用这些PC,我们使用与Gmail和FB的网站相同的设置,我们会收到不启用js的警告。

I have a website with the <noscript> tag that works just fine on all browsers except IE (7,8,9,10). After I disable scripting under the security settings inside Internet Options, On my PC only I can the the <noscript> content on IE, but on other PC's (almost all of them) I can't see the code. With these PC's we go with the same settings to Gmail's and FB's sites and we do get the warning for not having js enabled.

这是HTML:

<noscript>
    <div class="noscript">
        JavaScript must be enabled in order for you to use WEBSITE NAME in standard view.<br />
        However, it seems JavaScript is either disabled or not supported by your browser.<br />
        To use standard view, enable JavaScript by changing your browser options, then <a href="">try again</a>. 
    </div>
</noscript>

CSS:

.noscript {
    background: red;
    color: #fff;
    padding: 10px;
    text-align: center;
    position: relative;
    z-index: 3;
}

有任何想法吗?

谢谢!

推荐答案

也遇到这个问题。我有这工作在IE,然后它停止所有的突然。我发现如果你的css嵌套在noscript标签下面,在你的实际CSS定义,它工作。如果你只使用一个类名称它的罚款。

Encountered this issue as well. I had this working in IE and then it stopped all of a sudden. What I found is that if your css is nested beneath a noscript tag in your actual css definition it will not work. If you use just a class name its fine.

我使用IE 10测试和他们的开发工具将文档模式更改为较旧的浏览器模式进行验证。使用旧版浏览器时,结果可能会有所不同。

I'm using IE 10 to test with and their dev tools to change the document mode to older browser modes to verify. Results may vary when actually using older browsers. Report back if this is the case.

Example html:

不起作用

// classes nested beneath a noscript tag are not applied by IE
noscript div.noscript {
        display: block;
        text-align: center;
        color: white;
        font-weight: 700;
        background: #D53333;
        margin: 0 auto;
        padding: 4px;
    }

有效:
$ b

Does work:

div.noscript {
    display: block;
    text-align: center;
    color: white;
    font-weight: 700;
    background: #D53333;
    margin: 0 auto;
    padding: 4px;
}

这篇关于noscript标签不工作在互联网浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆