Popup Name Detect

Discussion in 'JavaScript' started by RobinDeanDotCom, Feb 24, 2007.

  1. #1
    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?
     
    RobinDeanDotCom, Feb 24, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    
    if (name == 'SOMENAME')
    {
        // Do whatever
    }
    else
    {
      // Do something else
    }
    
    Code (javascript):
     
    nico_swd, Feb 24, 2007 IP