user1390504
user1390504

Reputation: 183

Jquery load refresh div

I am trying to update my div with ajax and jquery. The ajax request is performed correctively and the database is updated, the div is not reloading however.

The methode update(ajax) is called, however. The $stats div is not updating. Can anyone help me out please? Directly calling the stats.php file DOES display the correct html output.

EDIT: code snippets removed.

Upvotes: 2

Views: 2898

Answers (1)

scessor
scessor

Reputation: 16125

Using prototype and jQuery at the same time can create conflicts because both use the $ (also see Using jQuery with Other Libraries). You should call jQuery.noConflict(); directly after inserting jQuery and use $ only for prototype, for jQuery use jQuery instead:

Add directly after <script type="text/javascript" src="js/jquery.js"></script> in the index.php:

<script>
     jQuery.noConflict();
</script>

And replace in the script.js the update function with:

function update(ajax){
    jQuery("#stats").load("stats.php");
}

Upvotes: 2

Related Questions