pickledegg has asked for the wisdom of the Perl Monks concerning the following question:

I'm currently using the CGI redirect to send my browser to a file.

Is there a way of redirecting but into a new window, similar to target="_blank" in html?


Thanks

2006-10-21 Retitled by g0n, as per Monastery guidelines
Original title: 'How can I redirect into new window?'

  • Comment on (OT) How can I redirect into new window?

Replies are listed 'Best First'.
Re: (OT) How can I redirect into new window?
by ikegami (Patriarch) on Oct 18, 2006 at 12:47 UTC

    As you asking if there's a way of generating that bit of HTML using CGI's HTML building methods? Yeah, -target => '_blank'. This is rather obvious from the CGI.

    Update: No, I guess you're not asking that. The CGI script cannot decide in which pane it will appear since it has already been decided. You need to specify target="_blank" on the <form> or <a> tag used to call the CGI script.

      Yes, I'm asking the latter, so if its already been decided, could I call the cgi script in a new window initially?

      I'm calling using the javascript window.location = link; method, so I guess my answer lies beyond the realms of the monastery :)

      EDIT: I've solved it now using Javascript to open the new window as the script is called, then the redirect in new window comes naturally.

      Thank you for helping me think 'outside the current browser window' ;)