2

I am facing an issue: I need to do html meta refresh (because I do windows gadget, this is only thing what works in Internet Viewer (not Internet Explorer), there is no location.href or anything similar (it always opens in new windows instead of currect gadget windows). Therefore onhly HTML meta refresh works to link a page.

So I was tweaking the JS to have a variable into the meta refresh, and it works only in chrome, but it doesnt work in ordinary Internet Explorer... once I make it work in IE, it shall work in gadget windows too.

How to adapt this code to work on Internet Explorer (if you have a chance to try it out in Internet Viewer, would be even better).

<html>
  <head>
  </head>
  <body>

    <meta http-equiv="refresh" content="5;url=http://www.google.com">
    <script>
      var username = "jzaloudek";
      var url = "http://localhost/excel/test.php?name=" + username;
      var time = 5;
      document.getElementsByTagName("META")[0].httpEquiv = "refresh";
      document.getElementsByTagName("META")[0].content = time + ";url=" + url;
    </script>

    <p>Loading...</p>
  </body>
</html>
Jiri Zaloudek
  • 326
  • 3
  • 19
  • 2
    Put the meta tag and the script into `head` section. – Teemu Feb 09 '18 at 07:06
  • Teemu: it did not help... in head section works only in chrome, not in IE. – Jiri Zaloudek Feb 09 '18 at 08:38
  • No? Just a suggestion, comment out the `httpEquiv="refresh"` line, and retry, what happens? – Teemu Feb 09 '18 at 08:46
  • just tried this: also dowsnt work - just keep redirection to google only, wtf? :( – Jiri Zaloudek Feb 09 '18 at 09:22
  • Well, I've tested your code, and it looks like that the code really works in Chrome (and Opera) only, FireFox, Edge and IE are not respecting the edited meta tag. I even tried to remove the original meta tag, and create a new-one with the new address, but no help, google page was still opened. I'm afraid the answer to the question is "You can't". – Teemu Feb 09 '18 at 10:03
  • the File>Properties menu in IE will tell you which IE Security zone your test/development website is mapped to. IE has security restrictions for navigating into a zone of lower integrity. You are using localhost and google domains. Both should map to the internet zone. There is also a security zone setting for the meta refresh tag. Internet Options>Security tab, click "Reset all zones to default". – Rob Parsons Feb 09 '18 at 19:43

0 Answers0