Jean-Mathieu
Jean-Mathieu

Reputation: 41

Refresh part on my Page

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

Answers (2)

RemS
RemS

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

Nauphal
Nauphal

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

Related Questions