I need to change the var state
on success, but debugging the js code, it doesn't call the success function at all, even though there is success. The state variable remains undefined. I'm not sure why it doesn't change. Looking at the network using firebug, the response is {"d": 1}
, which is the value the state should have. Any help is appreciated
var state;
$.ajax({
url: "isoServe.asmx/GetStatus",
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
state = msg.d;
},
error: function() {
alert("Error" );
}
});
return state;