0 votes
in JQuery by
Difference between jQuery.get() and jQuery.ajax()?

1 Answer

0 votes
by

In the get() method, we have to pass individual arguments, whereas the ajax() methods get all those arguments as an object.

jQuery.ajax({

url: 'mydoc.txt',

dataType: 'text',

type: “GET”,

success: function(data) {

console.log(data);

}

});

get() method accepts arguments. The three main arguments passed are explained below:

jQuery.get('mydoc.txt',function(data){

console.log(data)

},'text');

In this, the first argument is the url, the second is the callback function, and the third (‘text’) is the return type.

...