Reputation: 9040
Here is my original ajax query:
var url = ajaxPath+ "?s=search&r="+resource+"&q="+query;
$.getJSON(url,function(data){
Here is my updated query:
$.getJSON(ajaxPath,{s:"search",r:resource,q:query},function(data){
The updated one is not working for some reason. any ideas why?
Upvotes: 0
Views: 30
Reputation: 12847
No where in your example are you specifying POST
so GET
will be used as default.
That $.getJSON() function get's converted to this, this is what I prefer as it is very clear:
$.ajax({
dataType: "json",
type: "POST",
url: url,
data: data,
success: function(result,status,xhr){
}
});
data would obviously be in the form of a JSON
object.
Upvotes: 1