JS 中setInterval的问题 在Chrome中没有问题,在IE中不好使
<scriptlanguage="javascript"type="text/javascript">//读取信息functionRefreshMessage(){var...
<script language="javascript" type="text/javascript">
//读取信息
function RefreshMessage() {
var Userid = 2;
var ReverseTypeID = 0;
var AreaId = 370100
$.ajax({
url: "/SystemMessage/GetMessageBySomeId?UserID=" + Userid + "&ReverseTypeID=" + ReverseTypeID + "&AreaId=" + AreaId,
type: "post",
success: function (result) {
$('#Contents').load('/SystemMessage/GetMessageBySomeId?UserID=' + Userid + "&ReverseTypeID=" + ReverseTypeID + "&AreaId=" + AreaId);
}
});
}
$(document).ready(function () {
//十秒钟刷新一次
setInterval("RefreshMessage()", 10000);
});
</script> 展开
//读取信息
function RefreshMessage() {
var Userid = 2;
var ReverseTypeID = 0;
var AreaId = 370100
$.ajax({
url: "/SystemMessage/GetMessageBySomeId?UserID=" + Userid + "&ReverseTypeID=" + ReverseTypeID + "&AreaId=" + AreaId,
type: "post",
success: function (result) {
$('#Contents').load('/SystemMessage/GetMessageBySomeId?UserID=' + Userid + "&ReverseTypeID=" + ReverseTypeID + "&AreaId=" + AreaId);
}
});
}
$(document).ready(function () {
//十秒钟刷新一次
setInterval("RefreshMessage()", 10000);
});
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询