Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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

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


From the 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!)


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>"","_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..."

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:


For Netscape:
window.outerHeight = 500;
window.outerWidth = 400;

Just some 2 cents. I'm cheap.


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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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?

    What's my password?
    Create A New User
    [Eily]: I actually used the eskimo greeting :P, I just wrote the "canonical" form of the oneliner here
    [Discipulus]: next time you can add `SARGV-1` and if still not impressed pass a 'rm -f..' as last arg
    [Eily]: :)
    [Eily]: or I might be tempted to send him an Acme::EyeDropsed file next time
    [Eily]: Acme::Bleach is tempting, but it will look like I'm just using the one module that does precisely exactly what he wants

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (8)
    As of 2017-04-26 15:14 GMT
    Find Nodes?
      Voting Booth?
      I'm a fool:

      Results (483 votes). Check out past polls.