Elle Bolt
Posts: 0
Joined: Mon Jan 13, 2014 5:56 pm

Code not working on iOS device

what is wrong with my code? it works in browser but does not work on iPhone.

var list = JSON.parse(localStorage.getItem("theListSelectMenu_array"));

Array.prototype.uniqueObjects = function (props) {
function compare(a, b) {
var prop;
if (props) {
for (var j = 0; j < props.length; j++) {
prop = props[j];
if (a[prop] != b[prop]) {
return false;
}
}
} else {
for (prop in a) {
if (a[prop] != b[prop]) {
return false;
}
}

Code: Select all

     } 
     return true; 
 } 
 return this.filter(function (item, index, list) { 
     for (var i = 0; i < index; i++) { 
         if (compare(item, list[i])) { 
             return false; 
         } 
     } 
     return true; 
 }); 

};

var uniquestoreName = list.uniqueObjects(["storeName"]);
var uniquestoreId = list.uniqueObjects(["storeId"]);
var uniquestoreKnowName = list.uniqueObjects(["storeKnowName"]);

var dropDown = Appery("mobileselectmenu_12");
dropDown.empty();
dropDown.append(
$('' + "Select a Store" + '')
);
$.each(uniquestoreName, function(index, option) {
dropDown.append(
$('' + option.storeName + '')
);
});
dropDown.selectmenu("refresh");

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Code not working on iOS device

Hi Elle,

Are there any errors in console? Please try debugging with Weinre: http://devcenter.appery.io/documentat...

Elle Bolt
Posts: 0
Joined: Mon Jan 13, 2014 5:56 pm

Code not working on iOS device

Thanks a mil!!! you are the best all sorted silly mistake!!!

Thanks again.

Return to “Issues”