js 概率計算(簡單版)
更新時間:2017年09月12日 18:33:26 投稿:mdxy-dxy
這篇文章主要介紹了js 概率計算(簡單版),需要的朋友可以參考下
核心代碼:
//7:3運算 if(Math.ceil(Math.random()*10)>3){ //占比=7 alert('7'); window.location. rel="external nofollow" ; }else{ //占比=3 alert(3); widnow.location.href="http://chabaoo.cn"; }
通過隨機數大小來判斷,最好訪問哪個網址。大家可以根據自己的需求修改即可。
相關文章
Sample script that displays all of the users in a given SQL
Sample script that displays all of the users in a given SQL Server DB...2007-06-06js通過googleAIP翻譯PHP系統(tǒng)的語言配置的實現代碼
一同事弄了個系統(tǒng)是php寫的,雖然是多語言但沒中文!他打算手動翻譯2000多個語言配置,真是佩服,知道后想了想,應該有好的法辦2011-10-10uniapp踩坑實戰(zhàn)之文件查找失敗:'uview-ui'?at?main.js解決辦法
這篇文章主要給大家介紹了關于uniapp踩坑實戰(zhàn)之文件查找失敗:'uview-ui'?at?main.js的解決辦法,文中通過代碼介紹的非常詳細,需要的朋友可以參考下2023-12-12