Here is my Ajax request:
$ .ajax ({
url: '',
type: 'POST',
data: JSON.stringify ({country: jcountry, region: jregion, from: jfrom, to: jto, currency: jcurrency}),
processData: false,
Content-Type: 'application / json',
dataType: 'json',
success: function () {
alert ("success")
$ .mobile.changePage ("menu1.html");
},
error: function (xhr, ajaxOptions, thrownError) {
alert ("Error:" + xhr.status + "\ n" +
"Message:" + xhr.statusText + "\ n" +
"Response:" + xhr.responseText + "\ n" + thrownError);
$ .mobile.changePage ("menue2.html");
}
});
If I do not specify the type of content, I no longer see my request with firebug. Otherwise, when I add the content type, I can see the POST request (with an error because my URL is false), but in my header the content type is the default URL encoding.
I want to send information about my form via JSON data. Thanx for your help
source share