Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

console errors

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.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

console errors

app shared, app name "newfrombackup"

thx Marina

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

console errors

Hello Michael, I'll test this.

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

console errors

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.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

console errors

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);} );

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

console errors

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

console errors

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

console errors

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.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

console errors

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.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

console errors

Glad it's working:)

Return to “Issues”