reading service response
Hi, i have a REST service response like this:
{
"result":"pass",
"errorcode":"0",
"body":""
}
and the result will be either 'pass' or 'fail'
and i thought i can write a JS like this:
---------------------------------------------------------------------------------------------if(result == pass) {
$.mobile.changePage("changes_saved.html", {transition: "pop"});
}
else {
$.mobile.changePage("changes_not_saved.html", {transition: "pop"});
}
but im getting an error in firebug:
ReferenceError: result is not defined
whats wrong with this JS?