when i run this program on browser i am getting response as fail, but run this in android phone i am getting reference error can't find variable data. Code perfectly works in emulator also. Help Me
<html>
<head>
<script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova-2.4.0.js"></script>
<script type = "text/javascript">
function getResponse(){
var url = "http://www.apexweb.co.in/apex_quote/phone_gap/uname_validation.asp?un=9999999999&pwd=123456789&callback=your_callback";
var head= document.getElementsByTagName('head')[0];
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= url;
head.appendChild(script);
your_callback(data); //here i am getting reference error, can't find variable data
}
function your_callback(data){
var st = data.status;
alert(st);
}
</script>
</head>
<body>
<button input type = "button" onClick = "getResponse()"> GetResponse </button>
</body>
</html>
dataeither =\ Where is it supposed to be defined?your_callback,datais not defined to anything, so that should not be surprising. What do you wantyour_callbackto work with?your_callbackabpve the definition ofgetResponse.