DataZombies / jQTouch

jQT extensions jqt.activityIndicator, jqt.bars (with numeric badges), jqt.checkGroup & jqt.segmentedControl.Get updates via Twitter http://twitter.com/HeadDZombie. If you find this fork useful please make a donation via PayPal (http://tinyurl.com/2fpmx27). See below for demo links.
MIT License
159 stars 34 forks source link

Scrolling stops working when loaded on a slow link (non Wi Fi) as a homepage app #45

Closed NickWallbridge closed 13 years ago

NickWallbridge commented 13 years ago

I had got my app working perfectly using the jqt.bars extension (thank you). Tested fine with iPhone (ios 4.2) on my home Wi Fi. I then tried the app when I was out (3G) and it failed to work (nothing else changed) The whole page simply moves including the areas that are supposed to be fixed and the content that is off the page never shows.

When I got home and connected to Wi Fi, everything started to work again.

I then tried it with the demo app at

http://web.me.com/djpinter1/iPhone/jqtouch/demos/main_tabbar/

with the same result. If started as a homepage app on a slow link then the app fails as above. Interestingly if the app is loaded in safari, it works fine. My app doesn't, so I am guessing this is a caching, size, timing issue?

DataZombies commented 13 years ago

I just tried the demo on my iPhone 3G (on 3G) and my wife's 1st gen model (on Edge). Edge was, of course, slower than snot in Antarctica, but both phones worked. How much free memory do you have? (Settings > General > About, 7th line)

I'd blame Verzon...even if you have AT&T.

P.S.: Your welcome & thanks for using my code. Have you seen the push I did yesterday?

DataZombies Beaver, Pennsylvania, USA DataZombies@gmail.com

The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.

On Mar 22, 2011, at 6:44 PM, NickWallbridge wrote:

I had got my app working perfectly using the jqt.bars extension (thank you). Tested fine with iPhone (ios 4.2) on my home Wi Fi. I then tried the app when I was out (3G) and it failed to work (nothing else changed) The whole page simply moves including the areas that are supposed to be fixed and the content that is off the page never shows.

When I got home and connected to Wi Fi, everything started to work again.

I then tried it with the demo app at

http://web.me.com/djpinter1/iPhone/jqtouch/demos/main_tabbar/

with the same result. If started as a homepage app on a slow link then the app fails as above. Interestingly if the app is loaded in safari, it works fine. My app doesn't, so I am guessing this is a caching, size, timing issue?

Reply to this email directly or view it on GitHub: https://github.com/DataZombies/jQTouch/issues/45

NickWallbridge commented 13 years ago

Wow - quick response!

I have 3GB free (of 16GB on iPhone 4)

I think I am using your latest push (bit new to GitHub!) - pulled today (DataZombies-jQTouch-61df2ad).

The problem is more subtle than I thought. If I upload the jqt.bars.js to my server and try again - it works - but only the first time. Subsequent attempts fail. It has got to be a caching/timing/sequence issue?

Phone is currently on GPRS if not on Wi Fi.

I don't know if relevant, but I see on the iScroll site ...

"onLoad Sometimes the DOMContentLoaded is a bit hasty and get fired when the contents are not ready. If you slip into some weird behaviors (eg: rubber band effect), try the following: ..."

He then recommends instantiating the iScroll object on a timer. Is this how jqt.bars does it?

If you want to try my app it is on:

http://eventingedge.com/mobile/checklist/index.html

Make sure you do it twice!

Have retried the demo - still not working unless I am on Wi Fi.

This is so frustrating. I can't blame Verzon or AT&T, I am in the UK on O2!!

DataZombies commented 13 years ago

Wow - quick response! Thanks. I try to be quick.

I think I am using your latest push (bit new to GitHub!) - pulled today (DataZombies-jQTouch-61df2ad). Yep, that's the latest & greatest

He then recommends instantiating the iScroll object on a timer. Is this how jqt.bars does it? Yes. Lines 217 - 227.

If you want to try my app it is on: You're gonna love this. The initial Safari load took over a minute. After I saved your app to the homescreen I launched it two times and it worked great. I even tried it a third time. No problems. Just wait...it gets even better!

I opened the app in desktop Safari, opened the Web Inspector and clicked the timeline button. It initially loaded slowly, subsequent loads when OK. However the timeline panel reported that every time I moused over a row the the paint function or the recalculate style event happened. This didn't happen on the demo. I think is because of the check boxes. Try posting a message on the jQT goog board to see if anyone has any suggestions. In the mean time, try the checkGroup extension in my repo.

Screenshot: http://img7.imageshack.us/img7/384/screenshot20110322at852.png

P.S.: It's still Verizon's fault.


DataZombies Beaver, Pennsylvania, USA DataZombies@gmail.com

The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.

On Mar 22, 2011, at 7:45 PM, NickWallbridge wrote:

Wow - quick response!

I have 3GB free (of 16GB on iPhone 4)

I think I am using your latest push (bit new to GitHub!) - pulled today (DataZombies-jQTouch-61df2ad).

The problem is more subtle than I thought. If I upload the jqt.bars.js to my server and try again - it works - but only the first time. Subsequent attempts fail. It has got to be a caching/timing/sequence issue?

Phone is currently on GPRS if not on Wi Fi.

I don't know if relevant, but I see on the iScroll site ...

"onLoad Sometimes the DOMContentLoaded is a bit hasty and get fired when the contents are not ready. If you slip into some weird behaviors (eg: rubber band effect), try the following: ..."

He then recommends instantiating the iScroll object on a timer. Is this how jqt.bars does it?

If you want to try my app it is on:

http://eventingedge.com/mobile/checklist/index.html

Make sure you do it twice!

Have retried the demo - still not working unless I am on Wi Fi.

This is so frustrating. I can't blame Verzon or AT&T, I am in the UK on O2!!

Reply to this email directly or view it on GitHub: https://github.com/DataZombies/jQTouch/issues/45#comment_905523

NickWallbridge commented 13 years ago

Good News - I have a workaround. It is definetely a .js caching issue.

I was thinking there has to be something different about my iPhone. The fact that it is an iPhone 4? Version of iOS? More memory? Particularly long load times on your tests? Could it be mine IS caching and yours is not and that is causing the problem? That would fit in with the app working when I upload to the web server again - presumably causing the code to be downloaded on that run? So is there a way to prevent a .js file being cached? Yes ...

    <script src="jqt.bars/jqt.bars.js?<?php echo time(); ?>" type="application/x-javascript" charset="utf-8"></script>

Bingo - it now works on and off Wi Fi.

However, there must still be an underlying problem.

I don't know enough yet to be sure, but aren't lines 217 - 227 the iscroll refresh? What about the instantiation? The code fragment from the iscroll site is:

setTimeout(function () {
    myScroll = new iScroll('wrapper');
}, 100);

Re: Recalculate style issue. Thanks for the heads up, but one problem at a time - I will follow-up when this is sorted (and I understand what you are saying!!) Unless you think it is related?

I am heading to bed (2am in the morning here!) Thanks for taking a look at this - I am so impressed by jQTouch, iScroll and what you have personally done to bring them together. I hope I will eventually be able to contribute.

DataZombies commented 13 years ago

Have you tried to empty the iPhone's cache and doing a hard restart?

NickWallbridge commented 13 years ago

Have now and it made no difference, works first time, fails second and subsequent. This link goes to my code without the workaround:

http://eventingedge.com/mobile/checklist/index2.html

Somewhat surprisingly, if I then clear cache between each run, it still doesn't work - so whatever "clear cache" does, it doesn't seem to clear out jqt.bars.js

Workaround is still 100% (on index.html).

NickWallbridge commented 13 years ago

Have got my son to test today on iPhone 4 iOs 4.3 - problem is reproducible on his device, so now pretty sure not specific to my iPhone although maybe an iPhone 4 issue. I am trying to track down someone with iPhone 3GS to test.

DataZombies commented 13 years ago

Could O2 be choking the download speed?

DataZombies Beaver, Pennsylvania, USA DataZombies@gmail.com

The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.

On Mar 24, 2011, at 5:04 PM, NickWallbridge wrote:

Have got my son to test today on iPhone 4 iOs 4.3 - problem is reproducible on his device, so now pretty sure not specific to my iPhone although maybe an iPhone 4 issue. I am trying to track down someone with iPhone 3GS to test.

Reply to this email directly or view it on GitHub: https://github.com/DataZombies/jQTouch/issues/45#comment_914301

NickWallbridge commented 13 years ago

It is possible - but even if they are, that is the environment in which the app has to run!

I know it is hard to debug when you can't reproduce - but I don't know where to go on this to either provide more info or have a more permanant fix. Over the weekend I plan to play with cache-manifest to see if that impacts positively or negatively on the issue as ultimately I would like the app to run standalone.

Have you had the chance to look at the iscrorll object creation? I just don't know enough to play with it yet.

By the way the standard "ToDo" demo has the same "recalculate style" issue you mentioned earlier.

DataZombies commented 13 years ago

Yes, I did look at cubiq's iscroll v4 docs. I'll give it a try over the weekend. Jonathan Stark has a couple of blog entries on remote debugging that might help: http://jonathanstark.com/blog/


DataZombies Beaver, Pennsylvania, USA DataZombies@gmail.com

The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.

On Mar 24, 2011, at 5:41 PM, NickWallbridge wrote:

It is possible - but even if they are, that is the environment in which the app has to run!

I know it is hard to debug when you can't reproduce - but I don't know where to go on this to either provide more info or have a more permanant fix. Over the weekend I plan to play with cache-manifest to see if that impacts positively or negatively on the issue as ultimately I would like the app to run standalone.

Have you had the chance to look at the iscrorll object creation? I just don't know enough to play with it yet.

By the way the standard "ToDo" demo has the same "recalculate style" issue you mentioned earlier.

Reply to this email directly or view it on GitHub: https://github.com/DataZombies/jQTouch/issues/45#comment_914679

DataZombies commented 13 years ago

Closing issue