Uncaught TypeError: $.ajax is not a function in Django

I have a function that works in the following manner:

        function ajax_display_schema_helper(schema_name){
            $.ajax({
                ...
                ...
                ...
            });
        };

        ajax_display_schema_helper('example schema');

But when I call the function above as following:

        $('.dropdown-item').click(function() {
            ajax_display_schema_helper(schema_name);
        });

I get the "$.ajax is not a function" error. What is the reason that it doesn't work when the function is called in the second way?

Back to Top