-
21 Jul 2011 5:55 AM #1
ScriptTagProxy and JSONP wrapped XML response
ScriptTagProxy and JSONP wrapped XML response
Is it possible to use ScriptTagProxy to handle XML data wrapped in JSONP?
Something like:
The server returns (with text/javascript):Code:var store = new Ext.data.Store({ model : 'MyModel', proxy : { type : 'scripttag', url : 'http://domain2/rest/jsonp/myModel/10000', reader : { type : 'xml', record : 'MyModel' } } })
I tried and got this error: 'Uncaught TypeError: Cannot call method 'querySelectorAll' of null'Code:stcCallback1001('<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<MyModel><id>10231<\/id><\/MyModel>')
Not sure if I didn't return the correct data format, or ScriptTagProxy simply can't handle XML data wrapped in JSONP response. Or something else went wrong.
-
21 Jul 2011 9:58 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 436
Why not use JSON then?
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.
-
21 Jul 2011 11:01 AM #3
That's fine. I was wondering if ScriptTagProxy supported wrapped XML, just not yet documented.
Our web service for native Android apps are serving XML in production, so I thought to reuse it that's all. If not, we will update it to support JSON as well
-
21 Jul 2011 4:04 PM #4
If developing for iOS, and wrapping with Phonegap, you could just use Ext.Ajax and you don't have to worry about cross-domain policies.
I do the testing with Safari on a mac (only browser and only platform to be able to test in my experience). But users won't have a problem accessing the info through your app in their devices, neither you while testing on the simulator with Xcode.
-
10 Sep 2011 12:02 PM #5


Reply With Quote