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 don't precise a Content Type, I can't see anymore my request with firebug. At the opposite when I add a Content type, I can see the POST request (with an error cause my URL is false) but in my header the content type is by default the url encoded form.
What I want is send the details of my form via JSON data. Thanx for your help