我发现this code使用jquery刷新我的div。这工作但我有任何问题。这个插件总是刷新我的div和打印结果。这个坏主意。我需要在div
时打印result
和result != 0
。在我的ie jquery print 0
中的结果div中。这个解决方案的任何方式?感谢
jquery代码:
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#load_tweets').load('record_count.php').fadeIn("slow");
}, 10000);
<body>
<div id="load_tweets"> </div>
record_count.php(非常简单)result = 0
0
答案 0 :(得分:0)
var auto_refresh = setInterval(function(){
$.ajax({
url:'record_count.php',
sucsess:function(data){
if(data!=0)
$('#load_tweets').html(data).fadeIn("slow");
}
});
}, 10000);
答案 1 :(得分:0)
试试这个:
var auto_refresh = setInterval(function () {
$.get('record_count.php', null, function(data) {
if (data != "0") {
$('#load_tweets').html(data).fadeIn("slow");
}
}, "html")
}, 10000);