兩個Javascript小tip資料
更新時間:2010年11月23日 21:16:43 作者:
兩個Javascript小tip資料,學習js的朋友可以參考下。
1. 定時循環(huán)執(zhí)行代碼
window.setInterval(function() {
$.get("service.aspx?method=unreadmessage", function(data) {
if (data != "0")
$('#unreadCount').html(data).show();
else
$('#unreadCount').hide();
});
}, 1000);可以類似這樣寫。
2. 刷新當前頁面
window.location.reload();
復制代碼 代碼如下:
window.setInterval(function() {
$.get("service.aspx?method=unreadmessage", function(data) {
if (data != "0")
$('#unreadCount').html(data).show();
else
$('#unreadCount').hide();
});
}, 1000);可以類似這樣寫。
2. 刷新當前頁面
復制代碼 代碼如下:
window.location.reload();
相關文章
微信小程序?qū)W習總結(jié)(五)常見問題實例小結(jié)
這篇文章主要介紹了微信小程序常見問題,結(jié)合實例形式總結(jié)分析了微信小程序常見錯誤、數(shù)據(jù)緩存、界面交換等相關操作技巧,需要的朋友可以參考下2020-06-06

