-
13 Sep 2012 12:18 AM #1
Unanswered: Very long response while loading JSONP
Unanswered: Very long response while loading JSONP
I try to load store by using JSONP
JSON output like:Code:var store = Ext.data.StoreManager.lookup('need_store'); store.setProxy({ type: 'jsonp', url: 'myurl' }); store.load();
I declare Mycallback function in index.htmlCode:Mycallback([['name1', 'id1', 'price1'], ['name2', 'id2', 'price2']]
MyController.LoadCode:<script type="text/javascript"> ... function Mycallback(data) { g_App.getController('MyController').Load(data); } </script>
So I don't add items into store. But indicator "Loading..." shows about 5 seconds! Chrome debug says, GET url takes 65 ms. What's wrong?Code:{ return; }
-
16 Sep 2012 4:05 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
The callback method name that should be returned in your response is automatically sent as a param in the request. You don't need to do anything client side, just use what is sent in your response.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Sep 2012 5:29 PM #3
I have invariable function name in JSON, and I must to declare my function in such way


Reply With Quote