0

Suppose my url is http://example.com#example.org i want to redirect my current tab "example.com" after 5 sec to query parameter "example.org"

<head>
<title></title>

<script type="text/javascript">
var x = window.location.hash.substr(1);
</script>

<meta http-equiv="refresh" content="4;url=x"/>

</head>
<body>
</body>
ankit3290
  • 11
  • 3

1 Answers1

1

Instead of using a meta tag to refresh, you should just use Javascript with a timeout to handle the redirect instead. A metatag cannot get a value passed in from Javascript using the approach you have.

<script type="text/javascript">
setTimeout(function() {
    window.location.href = window.location.hash.substr(1);
}, 5000);
</script>
Dwayne Charrington
  • 6,524
  • 7
  • 41
  • 63