Open HTML Meta Redirect in a new window

I need a webpage to redirect using the HTML meta tag and open this page in a new window. How can i do this?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Photo Gallery Redirect</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <meta http-equiv="Refresh" content="0; url=http://google.com">
    </head>
    <body>
    </body>
</html>
+1
source share
3 answers

You can not. You need to use javascript on the timer to open a popup (which will most likely be blocked by some browsers as an unsolicited popup)

You should probably choose a different approach to your problem.

+1
source

Can you do this! This is especially useful when updating is performed in an iframe (for example, on the canvas of a Facebook application page), and you want the update to load content into the main (parent) window.

- Javascript:

<meta http-equiv="refresh" content="5; URL=javascript:window.open('http://google.com','_parent');">
+10

You cannot do this with meta redirects. Take javascript.

<script type="text/javascript">window.open('http://google.com');</script>

Either that, or add target="_blank"to the source link / form that landed on this page "Photo Gallery Redirects."

<a href="http://google.com" target="_blank">click here</a>

or

<form action="http://google.com" target="_blank">
    <input type="submit" />
</form>

Not compliant with XHTML / HTML5, but it works. Alternatively, you can simply add rel="ext"and use some kind of Javascript snippet to place anyway target="_blank".

+3
source

Source: https://habr.com/ru/post/1709771/


All Articles