469,951 Members | 2,485 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Popup New Browser Window

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.
Jul 19 '05 #1
4 9543
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).

Jul 19 '05 #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.


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

Jul 19 '05 #3
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,scrollbar s=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
Jul 19 '05 #4
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,scrollbar s=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,directorie s=no,status=no,scrollbars=yes,copyhistory=no,heigh t=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

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by Shaun McKinnon | last post: by
12 posts views Thread by HarveyB | last post: by
4 posts views Thread by Newbie | last post: by
3 posts views Thread by Dan | last post: by
7 posts views Thread by E Michael Brandt | last post: by
7 posts views Thread by anthony.turcotte | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.