Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random popup : little problems !!

Status
Not open for further replies.

NaGaZaKi

Programmer
Mar 31, 2001
2
BE
Hi,
As sponsors often don't pay, I decided to use three. As I don't want to annoy visitors with three popup's, I want to randomly choose one of the three at each visit.

The problem is that they don't use the same way to open their popup so it isn't very easy to make it work together.

Here's the code I try to make work (like this it doesn't) :

Opener page :

<html>
<head>
<title>Opener page</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script src=&quot;Js/Rndmpop.js&quot; language=&quot;JavaScript&quot;>
</script>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
</body>
</html>

Rndmpop.js :

var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this = initArray.arguments;
}
}

link = new initArray(
&quot;<SCRIPT LANGUAGE=JAVASCRIPT> var account = 'xxxx';var category = '0';</SCRIPT><SCRIPT LANGUAGE=JAVASCRIPT SRC=\&quot;&quot;<SCRIPT LANGUAGE=JAVASCRIPT> <!-- window.open('location,'ocimp','toolbar=1,location=1,status=1,menubar=1,
scrollbars=1,resizable=1'); if (window.focus)
{window.focus();}// --></SCRIPT>&quot;,
&quot;<SCRIPT LANGUAGE=JAVASCRIPT> <!-- window.open('menubar=1,scrollbars=1,resizable=1'); // --></SCRIPT>&quot;
);

currentdate = new Date();
core = currentdate.getSeconds() % image.length;
var ranlink = link[core];
document.write(ranlink);

If you know why it doesn't work, or have another idea, that would be great to drop me a line.

Thanks a lot

NaGaZaKi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top