David Fung
Posts: 0
Joined: Wed Nov 28, 2012 4:52 pm

localStorage.item

I created a local storage variable "displayStatus" via the builder UI. Refer to the picture where the "status" is a boolean data field stored in parse.com.

Image

Upon the rest service execute completion, I added the following JS but nothing happened. Why?

var alertStatus = localStorage.getItem("displayStatus");

if (alertStatus == true){
Tiggzi('labelAlert').show();
Tiggzi('contactNo').show();
alert("Please call owner");
};

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

localStorage.item

Check the if-statement. alertStatus is string but being compared to true (boolean).

David Fung
Posts: 0
Joined: Wed Nov 28, 2012 4:52 pm

localStorage.item

Thanks for your support. The issue is resolved.
One more question. What is the syntax of serviceInstanceName.execute? I can't execute the REST service i this JS.

var alertStatus = localStorage.getItem("displayStatus");

if (alertStatus == "true"){
Tiggzi('labelAlert').show();
Tiggzi('contactNo').show();

serviceInstanceName.execute({'geoUpdate'});
serviceInstanceName.execute({'locationUpdate'});
};

David Fung
Posts: 0
Joined: Wed Nov 28, 2012 4:52 pm

localStorage.item

I got it. Thanks!

....
...
geoUpdate.execute({});
locationUpdate.execute({});
};

Return to “Issues”