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 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pop-Up Replacement

    I am looking for a code that loads a javascript launched pop-up into a pre-existing pop-up. Thanks.

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    window.open(url,name,features) Make sure the name is the same for the both popups. Then they will use the same window, if it is open alread, or create a new one with that name if it is not.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thats what i have

    this is what i have:

    scriptID='myScript1';
    cookieVRFY=0;

    AddLoad('http://www.***********/mobattack.php?&id=5',3);

    Where do I insert the above

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Please post the content of the AddLoad() function.

  • #5
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    var isNN, isIE, loadURLs=new Array(), loadTimes=new Array(), exitURL, loadURLno=0, scriptID, cookieVRFY;


    scriptID='myScript1';
    cookieVRFY=0;

    AddLoad('http://www.***********/mobattack.php?&id=5',3);

    function AddLoad(sURL,iTime)
    {
    loadURLs[loadURLno]=sURL;
    loadTimes[loadURLno]=iTime;
    loadURLno++;
    }


    function AddExit(sURL)
    {
    exitURL=sURL;
    }



    if (parseInt(navigator.appVersion) >= 4) {
    if (navigator.appName == "Netscape") {
    isNN = true;
    } else {
    isIE = true;
    }
    }

    function errorIgnore(e) { return true; }


    function openLoadWin() {
    var oldtime=0,mywins;
    for (mywins=0;mywins<loadURLno;mywins++)
    {
    setTimeout("window.open('"+loadURLs[mywins]+"','Loadwin"+mywins+"');self.focus();",(oldtime+loadTimes[mywins])*1000+10);
    oldtime+=loadTimes[mywins];
    }
    return true;
    }


    function openExitWin() {
    if (exitURL!='')
    {
    var ExitWin = window.open(exitURL,'ExitWin');
    self.focus();
    }
    return true;
    }
    if ( (cookieVRFY!=1) || (document.cookie.indexOf( scriptID+'PopupPRO=' )==-1) )
    {

    window.onerror = errorIgnore;


    if (isNN) {
    document.captureEvents(Event.UNLOAD | Event.LOAD | Event.ERROR | Event.CLICK);
    }

    openLoadWin();
    window.onunload=openExitWin;
    if (cookieVRFY==1){
    document.cookie=scriptID+'PopupPRO=HeyGuys!;path=/';
    }
    }

  • #6
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    BUMP! Help me out!

  • #7
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Seriously

    Help.

  • #8
    Regular Coder
    Join Date
    Feb 2004
    Location
    WA
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm.. Demanding help instead of requesting help... nice concept

    your problem seems to be in this line
    Code:
    setTimeout("window.open('"+loadURLs[mywins]+"','Loadwin"+mywins+"');self.focus();",(oldtime+loadTimes[mywins])*1000+10);
    try changing it to
    Code:
    setTimeout("window.open('"+loadURLs[mywins]+"','Loadwin');self.focus();",(oldtime+loadTimes[mywins])*1000+10);
    Nobody is Perfect. I am Nobody.

  • #9
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks so much

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    This would make it easier to understand and faster to execute.
    Code:
    setTimeout(function(){window.open(loadURLs[mywins],'Loadwin');self.focus()}, (oldtime+loadTimes[mywins])*1000+10);
    or with indention
    Code:
    setTimeout(
      function(){
         window.open(loadURLs[mywins], 'Loadwin');
         self.focus();
      }, 
      (oldtime+loadTimes[mywins])*1000+10
    );


  •  

    Posting Permissions

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