Debt Consolidation - Debt Consolidation - Premium wordpress themes - Online Schooling - Debt Consolidation

PDA

View Full Version : Activate Javascript based on random chance


«þ»
Dec 3rd 2007, 6: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, 8:02 am
In your body.onload:


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