Page 2 of 2

console errors

Posted: Mon Apr 01, 2013 3:51 pm
by Maryna Brodina

Yes, please share the app, we'll test it on device, but it might take some time. Someone will get back to you with an update.


console errors

Posted: Mon Apr 01, 2013 3:56 pm
by Michael4771079

app shared, app name "newfrombackup"

thx Marina


console errors

Posted: Tue Apr 02, 2013 8:34 am
by Kateryna Grynko

Hello Michael, I'll test this.


console errors

Posted: Tue Apr 02, 2013 1:52 pm
by Kateryna Grynko

In JavaScriptpage asset replace myload function with the following:
codefunction myload(varName) {
var arr = localStorage.getItem(varName);
if(arr == null || arr=="") {
arr = new Array();
}
else {
arr = JSON.parse(arr);
}
return arr;
}/code
We added a condition for correct getting an empty value.
The problem is probably in non-initialized localStorage.


console errors

Posted: Tue Apr 02, 2013 2:08 pm
by Michael4771079

Thanks Katya,
replaced myload function, error in console after user registration and login, open addresses page still hangs and the error below

TypeError: options.sort is not a function
options.sort(function(a, b){return a.localeCompare(b);} );


console errors

Posted: Tue Apr 02, 2013 4:26 pm
by Maryna Brodina

Hi, in JavaScriptpage asset replace myload function with the following:

codefunction myload(varName) {
try {
var arr = localStorage.getItem(varName);
if(arr == null || arr=="") {
arr = [];
} else {
arr = JSON.parse(arr);
if ({}.toString.call(arr) !== "[object Array]") {
arr = [];
}
}
} catch(err) {
arr = [];
}
return arr;
}/code


console errors

Posted: Tue Apr 02, 2013 5:09 pm
by Michael4771079

Hi Marina,

I have replaced js, I got a new error, see screenshot,

this is strange,
register new user and login, when I click save address the error occurs and address is not saved

when I login with an older user that has address saved in db it lets me save new addresses and delete with no error

so the problems seems now to be on new users

tested in browser

Image


console errors

Posted: Tue Apr 02, 2013 6:21 pm
by Maryna Brodina

In JavaScriptpage asset replace save function with the following:

codefunction save(item, varName) {
try {
var arr = localStorage.getItem(varName);
if(arr == null || arr=="") {
arr = [];
} else {
arr = JSON.parse(arr);
if ({}.toString.call(arr) !== "[object Array]") {
arr = [];
}
}
} catch(err) {
arr = [];
}
arr.push(item);
localStorage.setItem(varName, JSON.stringify(arr))
}/code

One more thing - on Addresses screen in restservice6 in mapping from addresses to variable_name delete JS and add next:

codeif (value == "") {
return "[]&quot
}
return JSON.stringify(value);/code

Hope this helps.


console errors

Posted: Tue Apr 02, 2013 6:54 pm
by Michael4771079

Perfect Marina,
all working, no errors in browser, working on iphone as tiggzi ipa.

I have to raise my hat to all of you guys,
The A team!

thanks for all your effort on this.


console errors

Posted: Tue Apr 02, 2013 6:56 pm
by Maryna Brodina

Glad it's working:)