I have a toggle switch implemented in jQTouch. I want to set the switch position dependinging upon the output of ajax call. I'm calling jquery like below. But it is not working.
var request = $.ajax({
url: "/cgi-bin/devStat.sh",
type: "POST",
});
request.done(function(msg){
alert(msg);
if(msg[0] === "1")
$('#myCheckbox1').prop("checked", true);
});
request.fail(function(jqXHR, textStatus) {
alert("failed");
});
But I'm not getting anything back. Please help me how to get the information from ajax call.