You are here: irt.org | FAQ | JavaScript | Random | Q1194 [ previous next ]
What you can do is amend the script such that it only opens a popup window approx. every one in nth times, by adding a random number:
<script language="JavaScript"><!--
var nth = 10;
var rnd = Math.floor(Math.random() * nth) + 1;
if (rnd == nth) {
var windowHandle = window.open('popup.htm','windowName','width=400,height=400');
}
//--></script>