js中setInterval 使用ajax怎么进不去ajax方法?
请叫我卷毛 2015-10-15 10:41:20 <script type="text/javascript">
function refresh() {
var totalCount='<%=request.getAttribute("totalCount")%>';
alert(totalCount);
$.ajax({
//这里进不来???是这样写吗?
url:"${ctx}/sys/home_refresh.action",
type:"post",
success:function(data){
alert(data);
if(data>totalCount){
alert(data);
} else {
return false;
}
},error: function(){alert("获取失败");}
});
}
setInterval(refresh,3000);
</script>