Click to See Complete Forum and Search --> : Need a Redirect with new window opened
wkress
06-16-2004, 10:39 AM
I want to do a redirect like HEADER LOCATION=http;//... but I also want the redirect to open a new window (leaving the previous window in place).
I can do this in Javascript but window.open("new.htm", "blank") gets cut off by pop-up blockers so I'd like to avoid that.
Is there another way?
AdamGundry
06-16-2004, 11:44 AM
There are two ways you can open popup windows: using the target attribute in your links, and using the JavaScript window.open() call. The former is no longer available in the latest versions of XHTML, as you should not really be using popups at all.
If you must use popups, the generally accepted code to use looks like this:
<a href="page.html" onclick="window.open(this.href, 'name', 'options'); return false;">Link</a>
Adam
wkress
06-16-2004, 01:01 PM
Let's try this again....
I want to do the equivalent of a link with "target=_blank" but this is not a straight link or "on-click" situation. Instead I've got PHP code that can drop into html for the redirect.
<meta http-equiv="REFRESH" content="0;URL=http://....">
would give me the redirect and supposedly
<meta http-equiv="window-target" content="_blank">
would give me the new page, but in tests I haven't been able to link the two together ... I get the redirect but not in a new window.
AdamGundry
06-16-2004, 02:07 PM
In which case you will have to use JavaScript like this (and be susceptible to popup blockers):
<script type="text/javascript">
window.open('page.html', ...);
</script>
<noscript>
<p>You do not appear to have JavaScript enabled. Please proceed to the <a href="page.html">next page</a>.</p>
</noscript>
Adam
Charles
07-04-2004, 04:03 PM
Originally posted by wkress
I can do this in Javascript but window.open("new.htm", "blank") gets cut off by pop-up blockers so I'd like to avoid that. You cannot and, more importantly, you ought not to defeat my pop-up blocker. You are an evil person for even thinking of doing such a thing.
PeOfEo
07-04-2004, 04:37 PM
Ahhh, Charles! where did you come from?
MstrBob
07-04-2004, 05:55 PM
Ooh, the infamous Charles! And, BTW, what does this have to do with Accessibility, really?
DaveSW
07-05-2004, 04:54 AM
Maybe the fact he's trying to do it without javascript.
Hello Charles btw!
Ben Rogers
07-09-2004, 08:30 AM
Just ot be clear: impossible AFAIK; You can't use server side functions to open up a new window.
And... uhm... *pretends to know Charles* Welcome back!
David Harrison
07-10-2004, 10:57 AM
Originally posted by AdamGundry
There are two ways you can open popup windowsOriginally posted by AdamGundry
two waysOriginally posted by AdamGundry
twoSorry guys but I needed to repeat what Adam said, sometimes things just don't sink in the first time.
Ben Rogers
07-10-2004, 12:46 PM
Lavalamp I don't think you were clear enough. :rolleyes:
There's only two ways. :p