jquery - Json phonegap return result -
I am making a phonegap app for iPhone and Android. My code works fine in the browser, but when I try with phonegap, the phone displays the JSON result and does not provoke the code in the submit fonts, here is a picture that I have received when I click on submit button I get: $ ajax () and json.eval () but I got the same result,
form.onsubmit = function () {var formData = new formData (form); $ Ajax ({Type: 'Post', Data: FormData, url: 'http://server.com', Success: Function (Data) {console.log ("wa3 1"); Alert ('Your comment was successfully added ');}, Error: Work () {console.log ("wa3 2"); Warning (' There was an error adding your comment ')}}}); }
I think Ajax calls are not executed. Submit button sends the form but not with AJAX You are redirected to the server script page.
To stop this behavior, return ; Submit to your event. This code can send Ajax function datas so to send your HTML page form.
Comments
Post a Comment