Click to See Complete Forum and Search --> : Perl Server Redirect to NEW Window
dep2porter
06-22-2005, 12:01 PM
I have a simple question that hopefully has a simple answer.
I am a Perl novice.
In Perl, I can:
print "Location: http://www.xyz.net/ \n\n";
to redirect the viewer to another page in the same window.
How can I redirect the viewer to another page in a DIFFERENT (NEW) window that works for IE and Netscape?
dep2porter
Charles
06-22-2005, 07:14 PM
You can't, the internet doesn't work that way.
You'll need to use the "target (http://www.w3.org/TR/html401/present/frames.html#adef-target)" attribute in the calling document.
dep2porter
06-23-2005, 11:13 PM
In Javascript I can window.open()
In an HTML form I can set target=blank
I was just hoping that Perl would have an analogous method.
Another alternative would be to have some logic change the document.myform.target based on some user input which will change whether the perl script form action loads into the current window or a new window onSubmit.
Or, have the Perl write an HTML program that executes an onLoad=window.open() based on some user input or a Location: $URL for other user input...
of course, it would be easier to just have a simple means within Perl.
dep2porter
winged1
06-24-2005, 06:33 PM
Java and HTML are client side, Perl is server side, that's the difference that prevents perl from having your browser open another window. Your later considerations are correct, have perl serve up an html document that will contain the html/javascript for for opening the window.
dep2porter
06-25-2005, 09:42 PM
Thank you oh Winged1 !