In JQuery Ajax calls, which of the below is recommended? I know both are similar but is there an obvious advantage between these two?
Ajax call with URL Paramater.
$.ajax({
url: 'test.php?uAction=action&uType=type',
dataType: 'json',
success: function(data, status){
$.each(data, function(i,item){
});
},
error: function(){
output.text('There was an error loading the data.');
}
});
or Ajax call with parameter arranged in object
$.ajax({
url: 'test.php',
dataType: 'json',
data: {
uAction: 'action',
uType: 'type'
},
success: function(data, status){
$.each(data, function(i,item){
});
},
error: function(){
output.text('There was an error loading the data.');
}
});