< NOSCRIPT>不在Opera 11中工作? [英] <noscript> not working in Opera 11?

查看:118
本文介绍了< NOSCRIPT>不在Opera 11中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试我的noscript标签,当javascript被禁用时显示内容,这在Safari,Chrome,Firefox,Camino,IE6,IE7,IE8,IE9中都可以使用,基本上除了Opera以外(我正在运行版本11,如果它与该版本分离)。



在Opera 11中没有显示任何内容...是不支持noscript标记吗?什么是替代方案?



没什么可奇怪的:

 < noscript>请启用JavaScript。< / noscript> 

位于身体标签之间。

 < HTML> 
< body>
< script> alert('Hello World');< / script>
< noscript> Hello World!< / noscript>
< / body>
< / html>


解决方案

您确定您在Opera中禁用JavaScript:



菜单>>设置>>首选项>>内容>>取消选择启用Javascript



如果是这样,然后发布在这里你的整个文件的内容。

编辑






直到他们修复了版本11中的这个错误,我认为它会很快发生,您可以试试这个:

  < script type =text / javascript> 
<! -

document.write(< style type ='text / css'> .noScript {display:none;}< / style>);

// - >
< / script>

< span class =noScript>请启用浏览器的javascript。< / span>

你基本上使用javascript来显示隐藏没有脚本消息的CSS,但是如果javascript被禁用,没有办法显示CSS,因此消息将显示。


I am testing my noscript tags which display content when javascript is disabled, this works in Safari, Chrome, Firefox, Camino, IE6, IE7, IE8, IE9, basically everything but Opera (I'm running version 11, not sure if its isolated to that version).

In Opera 11 nothing is displayed... is the noscript tag not supported? and what is the alternative?

Nothing surprising:

<noscript>Please enable JavaScript.</noscript>

Located between the body tags.

<html>
<body>
<script>alert('Hello World');</script>
<noscript>Hello World!</noscript>
</body>
</html>

解决方案

Are you sure you disabled javascript in Opera:

Menu >> Settings >> Preferences >> Content >> Deselect "Enable Javascript"

If so, then post the contents of your entire file here.

EDIT


Until they fix this bug in version 11 which I reckon will happen shortly you can try this:

<script type="text/javascript">
<!--

    document.write("<style type='text/css'>.noScript { display: none; }</style>");

//-->
</script>

<span class="noScript">Please enable javascript in your browser.</span>

You are basically using javascript to show css which hides the no script message, but if javascript is disabled then there is no way that css can be displayed hence the message will show.

这篇关于&LT; NOSCRIPT&GT;不在Opera 11中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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