SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why will this not work?

    Head:
    Code:
    <script language="javascript" type="text/javascript">
    <!--
    function openwindow(file,title,width,height)
    {
    	window.open(file,title,config='scrollbars=yes,resizable=no,width,height')
    }
    //-->
    </script>
    Body:
    Code:
    <p><form action="" method="post">
    <input type="button" name="menu" value="Restaurant" onclick="openwindow(menu_1.php','Menu','width=600','height=600')" />
    <form></p>
    When the button is clicked, a new window opens. However, it is not 800x600 pixels.

    I need to be able to specify the width and height in an onclick event because there will be multiple buttons on a page and all of the new windows will need to be of various dimensions.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Aes,


    window.open(file,title,config='scrollbars=yes,resizable=no,width,height')

    Re the above: try killing "config=". The syntax should be:

    window.open(url, title, features)

    where features is a name/value pair separated by commas; there is no "config="

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •