How do you define $Ajax?


I’m sorry for a beginner question, this is my first time trying API calls and I encountered an error, it says "$ is not defined", I tried adding name after the dollar sign but still, again sorry for beginner question.

here’s my code:

var limit = 2;

    method: 'GET',
    url: '' + limit,
    headers: { 'X-Api-Key': 'MY API KEY'},
    contentType: 'application/json',
    success: function(result) {
    error: function ajaxError(jqXHR) {
        console.error('Error: ', jqXHR.responseText);

>Solution :

Did you import jQuery correctly?
This Syntax is part of jQuery

EDIT: for i.e. jQuery 3.6.0 just include before your <script> the following line:

<script src=""></script>

Resource: Google hosted libraries

Leave a ReplyCancel reply