in JQuery by
Q:
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.

Related questions

0 votes
0 votes
asked Nov 17, 2020 in JQuery by rajeshsharma
0 votes
asked Nov 20, 2020 in JQuery by sharadyadav1986
...