tags:

views:

170

answers:

2

I need web page to redirect via HTML meta and open that page in a new window. How can I do that?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
    <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&gt;
    </head>
    <body>
    </body>
</html>
+1  A: 

You can't do that with a meta redirect. Grab JavaScript.

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

Either that, or add target="_blank" to the originating link/form which landed in this "Photo Gallery Redirect" page.

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

or

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

Not XHTML/HTML5 valid, but it works. Else you can just add rel="ext" and use some piece of Javascript to silently put the target="_blank" in anyway.

BalusC
Beware of popup blockers for unrequested popup windows.
webdestroya
A: 

You can't. You need to use javascript on a timer to open a popup (which most likely will be blocked by some browsers as an unrequested popup window)

You are probably better off taking a different approach to your problem.

webdestroya