Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Popup Name Detect

    I have a script which works as follows ...

    function PopUp(url, name, width, height)
    {
    myWin = window.open (url, name, 'width=' + width + ', height=' + height + ', innerWidth=' + width + ', innerHeight=' + height + ', outerWidth=' + width + ', outerHeight=' + height + ', screenX=0, left=0, screenY=0, top=0, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, toolbar=0');
    }

    What I want to do is something like (coded wrong / badly, sorry - note CAPITOLS)

    function PopUp(url, NAME, width, height)
    {

    if NAME = "SOMENAME"
    {
    MYWINDOWONE = window.open (url, name, 'width=' + width + ', height=' + height + ', innerWidth=' + width + ', innerHeight=' + height + ', outerWidth=' + width + ', outerHeight=' + height + ', screenX=0, left=0, screenY=0, top=0, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, toolbar=0');
    }

    else MYWINDOW2 = window.open (url, name, 'width=' + width + ', height=' + height + ', innerWidth=' + width + ', innerHeight=' + height + ', outerWidth=' + width + ', outerHeight=' + height + ', screenX=0, left=0, screenY=0, top=0, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, toolbar=0');

    {

    Anybody have a suggestion to how I might go about this?

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    did u try finding out the syntax of the if construct?

  • #3
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    You'll need to enclose your if statement with parenthesis + for comparisson you'll have to use double "=":
    Code:
    if(statement == true)
    btw, next time use the CODE tags.
    Last edited by BarrMan; 02-25-2007 at 03:54 PM.


  •  

    Posting Permissions

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