Random Pgae in percentage [explanation needed]

LGZACRO

Newbie
Joined
Aug 31, 2013
Messages
17
Reaction score
0
Hello everyone, I am looking how to make that 30 percent of my "pictures.html" visitors would be redirected to page1.html, and 70 percent to page2.html?
I have found thes:

Code:
<script type="text/javascript">
(function(n){
 var pages = ['page1.htm', 'page2.htm', 'page3.htm'];
 n = n < 3? 0 : n < 8? 1 : 2;
 window.location.replace(pages[n]);
})(Math.floor(Math.random() * 10));
</script>

but I am not sure I understand it right... can anyone explain this?
 
Back
Top