Popup New Browser Window

Discussion in 'Perl' started by Dipesh Mehta, Dec 10, 2003.

  1. Dipesh Mehta

    Dipesh Mehta Guest

    Can anybody help me regarding how to open a new browser window with my
    specification from within perl script for new output? NB: I can do
    this easily with javascript.

    Thanks in advance.
     
    Dipesh Mehta, Dec 10, 2003
    #1
    1. Advertising

  2. Dipesh Mehta wrote:
    > Can anybody help me regarding how to open a new browser window with my
    > specification from within perl script for new output? NB: I can do
    > this easily with javascript.


    Unless you're talking about client-side Perl or a window on the server,
    can't be done. Your Perl is almost definitley running on your server,
    all it can do to the client is send data (which can be JavaScript, of
    course).
     
    Leif K-Brooks, Dec 10, 2003
    #2
    1. Advertising

  3. Dipesh Mehta wrote:
    > Can anybody help me regarding how to open a new browser window with my
    > specification from within perl script for new output? NB: I can do
    > this easily with javascript.


    Trivial. A browser is in no way different then any other external program
    and you would use system() to start it. Details see 'perldoc -f system'.

    Of course, if this is a secret CGI question, then the answer would be
    totally different, but as you didn't mention CGI I am assuming that you are
    dealing with normal Perl programs.

    jue
     
    Jürgen Exner, Dec 10, 2003
    #3
  4. Dipesh Mehta

    Dipesh Mehta Guest

    Dear Jue,

    Thanks for reply. At present, I use following combination to get a
    parsed html output in a user-defined browser window.

    HTML
    <a href="javascript:newpop('filename.htm')">Preview</a>

    JAVASCRIPT
    function newpop(filename) {
    cgiurl='http://www.domainname.com/cgi-bin/script.pl?file\='
    newurl=cgiurl+filename
    apopup =
    window.open(newurl,'note','toolbar=yes,location=no,top=50,left=50,directories=no,status=no,scrollbars=yes,copyhistory=no,height=400,width=600,');
    }

    and a perl script to parse the contents of input html document and
    print output to the newly opened window.

    Now I want to skip the javascript module and defining hyperlink on
    every page with the filename. I can get rid of the filename with
    HTTP_REFERER, but I don't know how to open new browser window with my
    specification. I am using linux based virtual hosting running apache.

    If you can help me in the matter or if you have any other solution to
    get the rid of this situation, always welcome and shall be
    appreciated.

    Dipesh
     
    Dipesh Mehta, Dec 16, 2003
    #4
  5. Dipesh Mehta wrote:
    > At present, I use following combination to get a parsed html output
    > in a user-defined browser window.
    >
    > HTML
    > <a href="javascript:newpop('filename.htm')">Preview</a>
    >
    > JAVASCRIPT
    > function newpop(filename) {
    > cgiurl='http://www.domainname.com/cgi-bin/script.pl?file\='
    > newurl=cgiurl+filename
    > apopup =
    > window.open(newurl,'note','toolbar=yes,location=no,top=50,left=50,directories=no,status=no,scrollbars=yes,copyhistory=no,height=400,width=600,');
    > }
    >
    > and a perl script to parse the contents of input html document and
    > print output to the newly opened window.
    >
    > Now I want to skip the javascript module and defining hyperlink on
    > every page with the filename.


    I don't know how to not use JavaScript, but maybe this does what you want:

    <a target="note" onclick="window.open('','note',
    'toolbar=yes,location=no,top=50,left=50,directories=no,status=no,scrollbars=yes,copyhistory=no,height=400,width=600')"
    href="http://www.domainname.com/cgi-bin/script.pl?file=filename.htm">
    Preview</a>

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Dec 16, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amir Shaz
    Replies:
    5
    Views:
    4,727
    Mahendra Bhatt
    Aug 31, 2012
  2. =?Utf-8?B?Tm92aWNl?=
    Replies:
    2
    Views:
    6,700
    Alan Ferrandiz Langley
    Jun 9, 2004
  3. Gordon
    Replies:
    3
    Views:
    330
    Steven Burn
    Apr 16, 2004
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    571
    Randy Webb
    Jun 19, 2004
  5. Raffi
    Replies:
    4
    Views:
    248
    Dr John Stockton
    Aug 12, 2004
Loading...

Share This Page