this is my javascript in the TideSDK 1.3.1 beta
$(document).ready(function(){
$("#button").click(function(){
var url = "http://www.abc.com/login.php";
var cookie;
var username = $("#email").val();
var password = $("#password").val();
if(navigator.onLine(connected)){
var client = Ti.Network.createHTTPClient({
onreadystatechange : function(e){
if(client.readyState == 4){
cookie = client.getResponseHeader("Set-Cookie");
}
},
});
client.open("POST",url);
client.send("username="+username+"&password="+password);
}
else{
$("p").text("Check your Internet Connection");
}
});
});
What I'm trying to do here is first check whether an internet connection is available or not and if its available then make an http connection to the server. The problem i'm facing is that navigator.onLine() doesn't work on TideSDK 1.3.1 and although i can make a connection(commenting navigator.onLine) and the debug console shows that the state's being changed the call-back function doesn't seem to be executing.....I'm using TideSDK Desktop and Tide SDK 1.3.1 beta
Thanks, for the help