0

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 -->
Salil
  • 46,566
  • 21
  • 122
  • 156

2 Answers2

1

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>
Andrew D.
  • 8,130
  • 3
  • 21
  • 23
0

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.

InvisibleBacon
  • 3,137
  • 26
  • 27
  • Some browsers will recognise its the same page even with a different hash tag (and will just navigate to the anchor for that page instead of reloading). Could potentially add a URL parameter with a random parameter. I.E. `www.site.com/page?reload` Might work? – Benno Sep 07 '11 at 14:01
  • True, although I'm confused why you would want to load the same page again anyway. It would probably be better to return the user to some sort of home page if the page you navigated to won't work on your browser. – InvisibleBacon Sep 07 '11 at 14:04