ajax为何不能定时刷新啊
街头诗人1 2017-02-26 03:18:03 $(function(){
getData();
window.setInterval(getData,3000);
});
function getData(){
var url= "<%=basePath %>msg";
var data = {content:${msg.msgContent}};
$.ajax({
dataType:"json";
type="post",
async:true,
url:url,
data:data,
timeout:2000,
success:function(data){
("#showMsg").html(data);
("#showMsg").slideDown(300);
("#showMsg").slideUp(300);
},
error:function(){
alert("请稍后再试");
},
});
}