-
17 Sep 2011 10:09 PM #1
XML Server Response Using Ajax
XML Server Response Using Ajax
Hi there,
Im trying to get an XML response from the server using Ext.Ajax.
Im able to get the response only if the App is on the server under the same domain.In the API Doc I noticed that inorder to use diff Domains Ill have to use the : Ext.data.ScriptTagProxy. If I need to access the server via the mobile do I need to use this as well or there is another way to get the response from the server?
I will also would like to wrapp the whole app using Phonegap...
Many thanks
mkariti
-
18 Sep 2011 12:20 AM #2
Thats correct - to get data from different domain use script tag proxy from client or fetch data on the server
-
18 Sep 2011 1:39 AM #3
Hi bharatn,
Many thanks for your confirmation but can you maybe explain how to apply this?
Here is my code:
How do I extract the values when using the script tag proxy? Also, what is the tag for? do I need to place it inside the head tag? and what is the callback=someCallback params?Code:Ext.regModel('Sun', { fields: ['timezone', 'sunset', 'civil', 'Coming_Friday'] }); var store = new Ext.data.Store({ model: 'Sun', proxy: { type: 'ajax', url: '', reader: { type: 'xml', record: 'sun' }, autoLoad: true } });Many thanksCode:<script src="http://domainB.com/users?callback=someCallback"></script> Ext.regModel('User', { fields: ['id', 'name', 'email'] }); var store = new Ext.data.Store({ model: 'User', proxy: { type: 'scripttag', url : 'http://domainB.com/users' } });
mkariti
-
19 Sep 2011 9:41 AM #4
Hi there,
Does anyone know how to use the script tag proxy or might have a good exmple of it?
Im still abit puzzled about how one must use it. Where does the following tag must go and what does it actually does...I get the main Idea and it seems like a nice trick but can you use an XML response with it or just a json one?
Will appriciate any curmbs of information...
<script src="http://domainB.com/users?callback=someCallback"></script>Cheers
mkariti
-
21 Sep 2011 9:42 PM #5
I too have same probelm.. Dont even have example related to this problm

-
10 Nov 2011 11:18 PM #6
hi guys,
even i need an example of scripttag.
Did u got any solution.
using scripttag can we access web service that returns xml response.


Reply With Quote