//轉(zhuǎn)數(shù)字為千分位
functionformat(input) {
varn=parseFloat(input).toFixed(2);
varre=/(\d{1,3})(?=(\d{3})+(?:\.))/g;
returnn.replace(re,"$1,");
}
//瀏覽器切換監(jiān)聽事件
document.addEventListener('visibilitychange',function(){
if(document.visibilityState!='hidden') {
//to-do
.....
//eg:location.reload(); //刷新頁面
});
}
});