Saturday, 15 June 2013

jquery - My Cordova Code Wont Work AJAX Call -



jquery - My Cordova Code Wont Work AJAX Call -

i dont know going on! cordova project wont allow me info ajax call! trying create phone call server user auth, now, focused on sending info server , having come alerted. do!

html, js, jquery

<head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi"> <title>hello world</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"> </script> <script type="text/javascript"> $(document).ready(function () { $("form").submit(function () { var uname = document.getelementbyid("username").value; var pword = document.getelementbyid("password").value; var postdata = { username: uname, password: pword }; $.ajax({ url: "http://www.yellowcabsavannah.com/test.php", type: "post", data: postdata, async: false, datatype: 'json', contenttype: 'json', cache: false, success: function (data) { var d = json.parse(data); alert(d); } }); homecoming false; }); }); </script> </head> <body> <form action=""> <input type='text' id="username" name="username" placeholder="username"> <br> <input type='password' id="password" name="password" placeholder="password"> <br> <input type="submit" id="submit" value="login"> </form> </body>

php

echo json_encode(array("username" => $_post["username"], "password" => $_post["password"]));

jquery ajax cordova

No comments:

Post a Comment