Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught TypeError: $.ajax is not a function

I'm making a small game project with a leaderboard table.

I'm trying to get the leaderboard from a mysql database to display using jQuery ajax and PHP but its giving me an error message.

My syntax seems to look fine so I'm not sure what the problem is.

$("#leader-btn").click(function() {

    $.ajax({
        type: "GET",
        url: "leaderboard.php",
        dataType: "html",
        success: function(response) {
            $("#leaderboard-box").html(response);
            $("#leaderboard-box").css("display","block");
        }

    });

});
like image 251
Zubair Ali Avatar asked Jul 13 '26 07:07

Zubair Ali


1 Answers

I had the same problem. It turned out that I was using jQuery slim instead of the full library.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!