Android jQuery AJAX requests may be missing parameters

When using jQuery to fetch JSON data from a service on an Android browser, depending on the setup the server may or may not receive all the parameters with the request.

Even though the following code is perfectly correct the "active" parameter is some cases never reaches the server:

 url : "/survey/listjson",
 dataType : "json",
 contentType: "application/json",
 cache : false,
 data: {"active" : activeOnly},
 success : function(e) {
  var surveys = [];
  for ( var i = 0, survey; survey = e[i]; i++) {
  surveys.push(new Survey().extend(survey));

To fix it, try removing the contentType and dataType parameters. It does not really help either the server or the client but in some (older) mobile browsers will cause issues.


Popular posts from this blog

Removing Malware and Bloatware from Lenovo K3 Note (K50-T5)

MurMurHash3, an ultra fast hash algorithm for C# / .NET

How to remove adware (browser hijack or pop-up malware) from Android