adrive has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl print "content-type: text/html \n\n"; print int(rand(1000));
#!/usr/bin/perl print "content-type: text/html \n\n"; print<<OUTPUT <HTML> <SCRIPT> var winobj; //is there no way to do this beside declaring a global? function popWindow(url){ var width = 700; var height = 500; var left = (screen.width - width)/2; var top = (screen.height - height)/2; var params = 'width='+width+', height='+height; params += ', top='+top+', left='+left; params += ', directories=no'; params += ', location=no'; params += ', menubar=no'; params += ', resizable=no'; params += ', scrollbars=yes'; params += ', status=no'; params += ', toolbar=no'; //refresh if window is still open if(winobj && !winobj.closed){ alert('reloading..'); winobj.location.href = url; }else{ alert('opening as new..'); winobj=window.open(url, 'x', params); } if (window.focus) {winobj.focus()} return false; } </SCRIPT> <BODY> <FORM ACTION="#"> <INPUT TYPE="BUTTON" VALUE="OPEN WINDOW" ONCLICK="popWindow('t +estperl.pl');"/> </FORM> </BODY> </HTML> OUTPUT
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PERL + javascript popup
by dhosek (Beadle) on Mar 05, 2008 at 05:52 UTC | |
by adrive (Scribe) on Mar 05, 2008 at 07:03 UTC | |
by dhosek (Beadle) on Mar 05, 2008 at 14:56 UTC | |
|
Re: PERL + javascript popup
by ikegami (Patriarch) on Mar 05, 2008 at 07:58 UTC |