Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

( #24890=categorized question: print w/ replies, xml ) Need Help??
Contributed by Mina on Jul 28, 2000 at 20:08 UTC
Q&A  > CGI programming


Description:

From the CGI.pm manual, one can get a new browser window to pop up if one uses:
$query = new CGI; [...] print $query->start_form(-target=>'_new'); [...]
My problem is that this opens a window of the same size as the original.

Now, is there a way to do this, by adding aditional arguments (that I don't know about) to the start_form, or, is there another way of doing this?

(In my time, all we had was HTML 2.0!)

~mina

Answer: How can I open a new browser window to a given size?
contributed by infinityandbeyond

Unfortunately, even Perl can't conquer all your problems. The solution here is to use a Perl programmer's least favorite friend...Javascri pt. Quick and easy javascript solution:

<script> window.open("script.pl","_new","width=1024,height=768"); </script>
Buttons (and many other HTML tags) can have JavaScript attributes, where you can insert code, as well.

Here are some useful URLs:

Infinity ... and Beyond
Answer: How can I open a new browser window to a given size?
contributed by cwest

Not with that function, not with specifying targets.

What you need to do is have <EVIL>JavaScript</EVIL> do the work for you and a plain form 'button'.

"At least it's not ASP..."

--
Casey
Answer: How can I open a new browser window to a given size?
contributed by Anonymous Monk

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

Answer: How can I open a new browser window to a given size?
contributed by icuc

Open new win

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (6)
    As of 2015-07-03 03:46 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (48 votes), past polls