954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problems With Ripple

Hi hope someone can can help im having a problem with how ripple is dealing with for loops when emulating an android app using html5 css jquery and jqtouch

simple loop

var len = 1;
for (i = 0; i <len; i++){
alert('foo');
}


run it through chrome all is well as expected;

run it through ripple (phonegap);

I get 6 alerts;

found some stuff saying it may be a bug in ripple and to change the device but still got the problem!!!!!

has anyone come across this and know a work around.

cheers in advance

Niall

nuttyniall
Newbie Poster
19 posts since Apr 2010
Reputation Points: 10
Solved Threads: 3
 

You could try the following diagnostic tests:Change alert("foo"); to alert(len); . Does it alert the right value? If you see "6" then you may be victim of persistent caching (an earlier version of your code).
Try running the code within a onload = function(){...} structure. If you still get 6 alerts, then it would appear that the window.onload event fires 6 times.
Remove the loop, leaving len=1; alert(len); . If you still get 6 alerts, then it would appear that the emulator loads the page (or at least the javascript) 6 times.
Airshow

Airshow
WiFi Lounge Lizard
Moderator
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: