My ajax call is as below
<script type="text/javascript">
function calling() {
var user = $('#username').val();
$.ajax({
type: 'POST',
//url: "myfirstwebservice.asmx/GetCustomer",
url: "http://www.mydomain.com/myfirstwebservice.asmx?op=GetCustomer",
data: "{'username':'" + user + "'}",
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
success: function (msg, status) {
alert("successful");
console.log(msg.d.password);
$('#myplace').html("your passowrd is " + msg.d.password);
},
error: function (msg, status) {
alert("failure");
console.log("failure");
console.log(msg);
$('#myplace').html("The status is " + status + " with msg= " + msg + " .<br />" + msg.statusText);
}
});
}
</script>
This i am packaging through online zipper available on phonegap.
my config.xml file is
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.phonegap.example"
versionCode="10"
version = "1.0.0">
<name>PhoneGap Example</name>
<description>
An example for phonegap build docs.
</description>
<author href="https://build.phonegap.com" email="support@phonegap.com">
arrest warrant
</author>
<access origin="http://www.mydomain.com/" />
Other details are
Version
1.0.0
PhoneGap
2.1.0
Is there anything which i am doing wrong as i am not getting the output.
Datatype should be json or jsonp? For my local machine i am using json(which is cross domain for database access and is working fine). What i am missing for my mobile device.
Webservice are in .NET 2.0 framework.
The url which i was using to get the jsonp is not actually returning the json response.
Click here
This url returns the json if somebody wants to try.