-->

Sencha Touch list doesn't load data in browser

2019-09-04 06:57发布

问题:

I have a really simple Sencha Touch 2.0.1 app made with Sencha Architect 2.0.0: a list of items loaded from a json file online (here).

If I export it to an APK and install it on my droid, it displays perfectly. However if I try it on Chrome or Safari, they say 'Loading...' then display the word 'empty' where the list should be.

I get this error in Firebug: GET http://listtest.webs.com/data.json?_dc=1344620739517&page=1&start=0&limit=25 x 166ms (where that 'x' is circled in red, meaning the request failed I guess). The Response field is blank, even though that's a valid URL.

Here are links to my full code. Thanks for any help you may have.

.xda archive: http://www.mediafire.com/?11ism2o13gkcz27
.zip file: http://www.mediafire.com/?f76by4d445vb6zu

Extra info: I'm using WAMPSERVER 2.2 with default config, and I've had this problem with most of my other apps as well. The CityBars tutorial from Sencha works completely in Chrome, and loads the title bar in Safari but does not load any items to click on.

Even a comment that says "that code worked/didn't for me" would be helpful.

回答1:

I used a PHP file + JsonP store instead, based on the source code from here.

It works perfectly. No special configs needed, just a default JsonP store with URL set to my new PHP file. For some reason nothing displays when I 'load data' manually, but it works in the browser and that's all that matters.