[jQuery] Automatic ajax call
페이지 정보
작성자 제로 작성일 21-10-31 23:08 조회 34,540 댓글 0본문
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
var callAjax = function(){
$.ajax({
method:'get',
url:'random.php',
success:function(data){
$("#sample").html(data);
}
});
}
setInterval(callAjax,2000);
});
</script>
<div id="sample">100</div>
random.php
<?php
print 5*rand(1,100);
?>
댓글목록 0
등록된 댓글이 없습니다.
