January 6, 2009
Im looking for a script that will do the following:
Called from a onUnload
Calculate a random number (between 0 and 1)
If random is <0.5 then:
- Randomly choose between three pages
- Display page via pop-up (over)
If random is >0.5 then do nothing.
Below is what Ive developed thus far:
------------------------
// WINDOW DIMENSIONS //
function popitup(url)
{
newwindow=window.open(url,'name','height=375,width=450,scrollbars=yes');
if (window.focus) {newwindow.focus()}
}
// SURVEY FUNCTIONS //
function chooseSurvey() {
};
var aRandom_number = matho.random() //Random Number Generation
if (aRandom_number <= 0.5) { //Incident Rate = 50%
homeAd = new chooseSurvey();
number = 0;
chooseSurvey[number++] = "
chooseSurvey[number++] = "
chooseSurvey[number++] = "
increment = Math.floor(Math.random() * number);
}
else { //If not selected, do nothing
}
--------------
Im looking for
- the JS file that Ill call when the page is loaded
- the onUnload text to put in the of the page
Thank you.Hi cclegg06-ga,
Let us start with the HTML you will put in the page. To use a
separate .js file that you want to call in your code, you can use the
...
...