Problem with innerHTML on iPhone

90 views
Skip to first unread message

Julio Rabadán González

unread,
Nov 10, 2010, 10:40:51 PM11/10/10
to phon...@googlegroups.com
Hi, all.

I need help, desesperately. We are developing an app for iPhone and Android with PhoneGap and we are facing a very distressing problem. My app is big. It has a lot of css, background images and js files. And the problem is that setting content thru innerHTML property is failing very often on iPhone.

Which are the best practices to avoid this problem?

Is there any workaround other than setting a timer? It also fails sometimes, when it reaches the retries limit.

It is very annoying, and probably any client will reject and app with this kind of fail. (I'm sure my one will do).

Any happy and glorious idea?

Many thanks

Julio Rabadan

Shazron Abdullah

unread,
Nov 10, 2010, 10:43:28 PM11/10/10
to Julio Rabadán González, phon...@googlegroups.com
Do a search on this group. It's been discussed and there is a workaround.

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

Julio Rabadán González

unread,
Nov 10, 2010, 10:50:37 PM11/10/10
to Shazron Abdullah, phon...@googlegroups.com
Thanks, Shazron.

I saw the workaround (using a setTimeout to try it again). I have integrated it in my code, but it also fails sometimes when it reaches a number of retries.

Julio

Shazron Abdullah

unread,
Nov 10, 2010, 10:56:21 PM11/10/10
to Julio Rabadán González, phon...@googlegroups.com
How many retries are you setting typically?
I set a minimum of 20, sadly

Julio Rabadán González

unread,
Nov 10, 2010, 11:03:42 PM11/10/10
to Shazron Abdullah, phon...@googlegroups.com
20? Ok... now i'm using 5 :)
And the timeout? I'm using 50 milliseconds. 20 retries will take 1 second...

I was think also about using appendChild instead of innerHTML, with DOM objects. Have you tried this?

Shazron Abdullah

unread,
Nov 10, 2010, 11:25:08 PM11/10/10
to Julio Rabadán González, phon...@googlegroups.com
Im using 50ms as well... Typically it won't get to 20...

Julio Rabadán González

unread,
Nov 11, 2010, 8:42:46 AM11/11/10
to Shazron Abdullah, phon...@googlegroups.com

Tested and working perfectly on real device.
Many thanks for your help!

El 11/11/2010 00:25, "Shazron Abdullah" <shazron....@nitobi.com> escribió:

Im using 50ms as well... Typically it won't get to 20...


On 2010-11-10, at 3:03 PM, Julio Rabadán González wrote:

> 20? Ok... now i'm using 5 :)

> And the ...

Reply all
Reply to author
Forward
0 new messages