Reputation: 41
I'm trying to refresh this part of the page
<div class="refresh">
<?php
include("message.php");
?>
</div>
with this code :
<script type="text/javascript">
var auto_refresh = setInterval(
function () {
$('#refresh').empty();
$('#refresh').load('message.php');
}, 500);
</script>
Could you help me?
Upvotes: 0
Views: 53
Reputation: 280
if you are using $('#refresh') then "#" represents the id, so change this
<div class="refresh">
to
<div id="refresh">
or change this
$('#refresh')
to
$('.refresh').
Upvotes: 2
Reputation: 6192
change this
<div class="refresh">
To
<div id="refresh">
because you are using id
selector in jquery to load the content.
Upvotes: 3