javascript - Check if local storage value is equal to -


i know how check value of item stored in local storage true or false.

this have , if statement isnt working.

function setcbt(){ localstorage.setitem('testobject', true);  }   function alertlocalstorage(){ var object = localstorage.getitem('testobject');  if(object == true) {     alert("this item true"); } else {         alert("this item false");  }  } 

all implementations safari, webkit, chorme, firefox , ie, following old version of webstorage standard, value of storage items can string.

thus need compare value string:

 if(object == "true") { 

here alternative posted cms.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -