...

View Full Version : Pop-Up Replacement



Malafic
04-27-2004, 01:45 AM
I am looking for a code that loads a javascript launched pop-up into a pre-existing pop-up. Thanks.

liorean
04-27-2004, 03:07 AM
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.

Malafic
04-27-2004, 07:03 AM
this is what i have:

scriptID='myScript1';
cookieVRFY=0;

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

Where do I insert the above

glenngv
04-27-2004, 08:39 AM
Please post the content of the AddLoad() function.

Malafic
04-27-2004, 11:31 PM
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=/';
}
}

Malafic
04-29-2004, 12:32 AM
BUMP! Help me out!

Malafic
04-29-2004, 11:16 PM
Help.

Unit
04-29-2004, 11:24 PM
hmm.. Demanding help instead of requesting help... nice concept :thumbsup:

your problem seems to be in this line


setTimeout("window.open('"+loadURLs[mywins]+"','Loadwin"+mywins+"');self.focus();",(oldtime+loadTimes[mywins])*1000+10);


try changing it to


setTimeout("window.open('"+loadURLs[mywins]+"','Loadwin');self.focus();",(oldtime+loadTimes[mywins])*1000+10);

Malafic
04-30-2004, 02:45 AM
thanks so much :)

glenngv
04-30-2004, 03:46 AM
This would make it easier to understand and faster to execute.


setTimeout(function(){window.open(loadURLs[mywins],'Loadwin');self.focus()}, (oldtime+loadTimes[mywins])*1000+10);

or with indention


setTimeout(
function(){
window.open(loadURLs[mywins], 'Loadwin');
self.focus();
},
(oldtime+loadTimes[mywins])*1000+10
);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum