calling a specific PHP function with AJAX
So I have a PHP function that queries a MySQL database and returns some HTML.
I'm trying to write an AJAX function that calls that function at a
specific time.
I am assuming the problem is I am calling a PHP page, not a php function.
Any help much appreciated!
Here is where I call the PHP function in the page.
<tbody>
<?php $getLeaderboard->getTable($_GET['competitionId']); ?>
</tbody>
My Ajax Function (That doesn't work)
function loadLeaderboard() {
var competitionId = $("body").attr("data-competitionId");
var url = "api/getLeaderboard.php?competitionId=" + competitionId;
$.get(url, function(data) {
//not sure where to load the results?
});
}
No comments:
Post a Comment