Popup New Browser Window

D

Dipesh Mehta

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.
 
L

Leif K-Brooks

Dipesh said:
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).
 
J

Jürgen Exner

Dipesh said:
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
 
D

Dipesh Mehta

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
 
G

Gunnar Hjalmarsson

Dipesh said:
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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top