Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How can I open a new browser window to a given size?

by Anonymous Monk
on Apr 10, 2004 at 03:57 UTC ( [id://344079]=note: print w/replies, xml ) Need Help??


in reply to How can I open a new browser window to a given size?

First, you should understand that you can't possibly do this in Perl, as Perl is not a client-browser-side language. So here is an off-topic Javascript technique.


--------

Assuming you are loading a document into the window:
JavaScript *sigh* in an onLoad="blah()" function for the page to set the size...

The method used to resize the Window in Internet Explorer is as such:

<script>
self.resizeTo(500,400);
</script>

For Netscape:
<script>
window.outerHeight = 500;
window.outerWidth = 400;
</script>

Just some 2 cents. I'm cheap.

----Dave----

  • Comment on Re: How can I open a new browser window to a given size?

Replies are listed 'Best First'.
Re: Answer: How can I open a new browser window to a given size?
by zentara (Archbishop) on Apr 10, 2004 at 15:42 UTC
    I've used this general purpose javascript with Mozilla.
    print OUT<<End_Header; <html> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- function popitup(url,w,h) { newwindow=window.open(url,'name',"width="+w+",height="+h+""); newwindow.document.open(); newwindow.document.write('</body></html>'); newwindow.document.write('<html><title>'+url+' CLICK TO CLOSE</title>< +body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" o +nBlur="self.close()" onClick="self.close()">'); newwindow.document.write('<img src='+url+' height='+h+' width='+w+' a +lt=['+url+'] align=center >'); newwindow.document.write('<INPUT type="button" value="Close Window" on +CLick="window.close();">'); newwindow.document.write('</body></html>'); newwindow.document.close(); if (window.focus) {newwindow.focus()} return false; } // --> </SCRIPT> <body> <table align=left bgcolor=9999CC border=2 cellpadding=2 cellspacing=2> <tr> End_Header
    and to call it
    print OUT<<EOTR; <td align=center><a href="javascript:;" onClick="return popitup('$pic' +,'$w','$h')"><img alt= [$pic-thumbnail] src=$thumb height=$th width=$ +tw></a><br>$pic</td> EOTR

    I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://344079]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-19 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found