I am trying to rotate between 2 different .js files in my website. Here is the code I have:
<script type="text/javascript">
<!--
var jsfiles = ['/js/green.js', '/js/blue.js'];
var randomLink = Math.floor(Math.random() * jsfiles.length);
document.getElementById('scriptid').src = jsfiles[randomLink];
//-->
</script>
<script src="" id="scriptid"></script>
Is there a way to ensure that green.js loads 98% of the time, and blue.js only 2% of the time?