1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
$("#submitButton").click(function(){
sumbitForm($("#country").val(), $("#region").val(), $("#from").val(), $("#to").val(), $("#currency").val());
});
});
function sumbitForm(jcountry, jregion, jfrom, jto, jcurrency) {
$.ajax({
url: 'url',
type: 'POST',
data: {country : jcountry, region : jregion, from : jfrom, to : jto, currency : jcurrency},
//headers: {'Content-Type' : 'application/json' },//contentType: 'application/json', ou JSON.stringify({
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");
}
});
} |
Partager