Ismael Collado
Ismael Collado

Reputation: 3

$.ajax is not a function, but the jquery library is working

I see this in the console:

jQuery.ajax is not a function

And this is my ajax:

    $("#aceptar").click(function(){

      dni = $("#dni").val();
      passw = $("#pass").val();

      alert(dni)
      alert(passw)


      $.ajax({
          type: 'POST',
          url:  'credenciales.php',
          dataType : 'html',
          data: {
              dni: dni,
              pass: passw,
          },
          success: function(suc) {

              alert("jaja")

          },
          error: function() {
          alert('An error occurred!');
          }
      });


  })

In the php file I only have an echo, but anyway the alert has a "jaja", not the php echo, and still not working.

All my other jQuery code is working without problem. Does this means that only the ajax function is wrong in the library? I have tried with other libraries and im always getting the same error.

Upvotes: 0

Views: 120

Answers (1)

Álvaro González
Álvaro González

Reputation: 146550

From the jQuery download page:

You can also use the slim build, which excludes the ajax and effects modules

Upvotes: 2

Related Questions