Syntax for jQuery.ajax() and jQuery.get() method: -
Syntax of ajax() method: -
jQuery.ajax({
url: 'test.txt',
dataType: 'text',
type: “GET”,
success: function(data) {
console.log(data);
}
});
Syntax of get() method:-
jQuery.get('test.txt',function(data){
console.log(data)
},'text');