Thank you. I'll update.
Thank you. I'll update.
i just used the same style code on a different service that responds with a 'true' or 'false' and gives back only the error popup (in the following example it always shows: "not_confirmed_pickup.html"):
the 'driver_picked_up2' service:
if(data.response==="true") {
$.mobile.changePage("confirmed_pickup.html", {transition: "pop"});
}
else {
$.mobile.changePage("not_confirmed_pickup.html", {transition: "pop"});
}
well, the 'driver_picked_up2' and 'submit_load2' services are exactly alike in the sense that they both send to the server just one request parameter - an id (which is an int), and the 'UpdateStatus2' service sends to the server several request parameters (which include strings and integers); but all three respond exactly alike (either a 'true' or 'false').
I hope that helps. Let me know, thanks.
If in response you get true/false (without quotes) and Data Type in service settings is set to json then in data will be boolean true or false. That's why it's better to use codeif(data) {
$.mobile.changePage("confirmed_pickup.html", {transition: "pop"});
} else {
$.mobile.changePage("not_confirmed_pickup.html", {transition: "pop"});
}/code
well, for 'submit_load2' service this code works now:
if(data==true) {
$.mobile.changePage("load_submitted.html", {transition: "pop"});
}
else {
$.mobile.changePage("load_not_submitted.html", {transition: "pop"});
}
and for 'driver_picked_up2' service this code works now:
if(data==true) {
$.mobile.changePage("confirmed_pickup.html", {transition: "pop"});
}
else {
$.mobile.changePage("not_confirmed_pickup.html", {transition: "pop"});
}
which is strange because they both are sending the same type of request parameter and responding with the same true or false, yet one has == and the other just =
sorry, for 'driver_picked_up2' service this code works now:
if(data=true) {
$.mobile.changePage("confirmed_pickup.html", {transition: "pop"});
}
else {
$.mobile.changePage("not_confirmed_pickup.html", {transition: "pop"});
}
you know what I dont know how i messed this up... I tested it again just to make sure and actually both of them do have two ==
for service 'UpdateStatus2', I'm still having issues... I also tried
if(data=true)
if(data==true)
if(data===true)
and none of those work. Any ideas?
the only difference in this case is that in its request parameters theres several strings an an id (integer), but the response is exactly the same as the other 2 that work: just true or false
Hi Marina, Im so sorry about this but I finally realized why the third service wasnt working... all three of them work now with: if(data==true)