开发者

Need a link which works depending on browser's javascript enabled/disabled

开发者 https://www.devze.com 2023-04-03 11:02 出处:网络
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.

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/>
    开发者_StackOverflow社区            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 -->


This works in my tests in IE8 and Chrome13

<html>
  <head>
  <noscript>
    Your browser do not support javascript or javascript is currently disabled.<br/>
    Enable javascript and press button &lt;Reload Page&gt;<br/>
    <form name="noscript_reload" method="GET">
      <input type="submit" value="Reload Page"/>
    </form>
  </noscript>
  </head>
<body>
  BODY TEXT
</body>
</html>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消