需要一个根据浏览器的 JavaScript 启用/禁用而起作用的链接
如果禁用了 javascript,我已经使用 style-sheet 和
实现了警报弹出窗口。 弹出窗口有警告消息和“确定”按钮。 在所有浏览器中禁用 javascript 之前,“确定”按钮将不起作用。 当启用 javascript 并且不重新加载页面时
On FF:-
单击“Ok”按钮页面会重新加载
其他浏览器:-
单击“Ok”按钮没有任何反应
我想要我的“Ok”按钮在所有其他浏览器(IE、Opera、Safari、Chrome)中表现得像 FF,我怎样才能实现这一点?
我的代码编辑后如下
<!-- [START] Following code is get runed to show pop-up when javascript is disabled -->
<noscript>
<div id="javascript_disabled_fade" class="black_overlay" style="display:block;"></div>
<div id="pagewrap-light-small" style="display:block;">
<div id="javascript_disabled_popup" class="white_content_javascript_disabled" style="margin-left:-185px;margin-top:-143px;width: 371px;height:287px;padding:0px;">
<div style="margin:0px;padding:0px;">
<table align="center" style="text-align:center;width:371px;height:287px; " cellpadding="0" cellspacing="0" border="0" >
<tr>
<td align="center" style="text-align:center;padding-left:2px;height:150px;padding-top:8px;" colspan="2">
<img style="border: 0px none ;" src="/images/logo-small.png"/><br/>
<img style="border:none;" src="/images/account_management.png"/>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="font-weight:bold;font-size:12px;color:#5a5a5a; text-align:center; line-height:18px;" >
The site makes extensive use of JavaScript.<br/>
Please enable <span style="color:red;">JavaScript</span> in your browser.
</td>
</tr>
<tr>
<td valign="top" align="center" style="padding-top:24px;" colspan="2">
<a href="javascript:void(0)" onclick="window.location.reload();" class="okGreen"></a>
</td></tr>
</table>
</div>
</div>
</div>
</noscript>
<!-- [END] Following code is get runed to show pop-up when javascript is disabled -->
I have implemented an Alert pop-up using style-sheet and <noscript>
if javascript is disabled.
The pop-up has warning message and Ok button.
Ok button will not work until the javascript is disabled in all the browsers.
When javascript enabled and w/o reloading the page
On FF:-
Clicking on Ok button page gets Reload
Other Browsers:-
Clicking on Ok button nothing happens
I want my Ok button to behave like FF in all the Other Browsers (IE, Opera, Safari, Chrome), how i can achieve this ?
Edited my code is as follows
<!-- [START] Following code is get runed to show pop-up when javascript is disabled -->
<noscript>
<div id="javascript_disabled_fade" class="black_overlay" style="display:block;"></div>
<div id="pagewrap-light-small" style="display:block;">
<div id="javascript_disabled_popup" class="white_content_javascript_disabled" style="margin-left:-185px;margin-top:-143px;width: 371px;height:287px;padding:0px;">
<div style="margin:0px;padding:0px;">
<table align="center" style="text-align:center;width:371px;height:287px; " cellpadding="0" cellspacing="0" border="0" >
<tr>
<td align="center" style="text-align:center;padding-left:2px;height:150px;padding-top:8px;" colspan="2">
<img style="border: 0px none ;" src="/images/logo-small.png"/><br/>
<img style="border:none;" src="/images/account_management.png"/>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="font-weight:bold;font-size:12px;color:#5a5a5a; text-align:center; line-height:18px;" >
The site makes extensive use of JavaScript.<br/>
Please enable <span style="color:red;">JavaScript</span> in your browser.
</td>
</tr>
<tr>
<td valign="top" align="center" style="padding-top:24px;" colspan="2">
<a href="javascript:void(0)" onclick="window.location.reload();" class="okGreen"></a>
</td></tr>
</table>
</div>
</div>
</div>
</noscript>
<!-- [END] Following code is get runed to show pop-up when javascript is disabled -->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这在我的 IE8 和 Chrome13 测试中有效
This works in my tests in IE8 and Chrome13
我认为在没有 JavaScript 的情况下让它“重新加载”的唯一方法是让你的“确定”按钮成为一个锚标记,其中的 href 指向同一页面。
I think the only way to get it to "reload" without javascript would be to make your OK button be an anchor tag with an href pointing to the same page.