Online Advertising - Mobile Phone - WoW Gold - Western Union - Mobile Phones

PDA

View Full Version : Activate Javascript based on random chance


«þ»
Dec 3rd 2007, 7:39 am
Apologies for this somewhat odd request, but is there a javascript that would only activate based on chance?

For example, I want a script that will make a javascript load only 20% of the time on that particular page.

Thanks for your help!

James McMurray
Dec 3rd 2007, 9:02 am
In your body.onload:


if (Math.random() >= 0.20)
function();