我有一个div刷新工作,但是可以避免在刷新的div中刷新DIV / SPAN
吗?
<script type="text/javascript">
$(document).ready(function(){
readings();
});
function readings(){
$('#readingss').load('test_update.php', function(){
setTimeout(readings, 1000);
});
}
</script>
<div id="readingss">
<span>I dont want this span to be refreshed</span>
<?php include('test_update.php'); ?>
</div>
答案 0 :(得分:0)
只需使用额外的包装
<script>
$(document).ready(function(){
readings();
});
function readings(){
$('#test_update_wrapper').load('test_update.php', function(){
setTimeout(readings, 1000);
});
}
</script>
<div id="readingss">
<span>I dont want this span to be refreshed</span>
<div id="test_update_wrapper">
<?php include('test_update.php'); ?>
</div>
</div>