-
23 May 2012 1:20 AM #1
Unanswered: Error - "xml can't be the whole program" while making cross-domain call to fetch xml
Unanswered: Error - "xml can't be the whole program" while making cross-domain call to fetch xml
I am new to extjs and using it to make a cross-domain call. This call returns xml. This is my code
<!DOCTYPE HTML>
<html>
<head>
<title>EXTJS Getting Started: MyApp</title>
<link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all.css">
<script type="text/javascript" src="/extjs/ext-all.js"></script>
<script>
Ext.define('QUERY_RESULTS', {
extend: 'Ext.data.Model',
fields: ['CONTENT']
});
var store = new Ext.data.Store({
model: 'QUERY_RESULTS',
proxy: {
type: 'jsonp',
url : 'http://sonewebsite.com/index?page=xmlfeed&channel=ALERTS&max=4&view=abc' ,
reader : {
type : 'xml',
record: 'QUERY_RESULT'
}
}
});
store.load();
alert(store);
</script>
</head>
<body> </body>
</html>It is giving me error as "xml can't be the whole program". I have checked through firebug, the response I am getting is correct, but the line " alert(store) " is not returning the desired response, instead its returning "[Object] [object]". How I can correct this issue ?
-
25 May 2012 12:14 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
- Answers
- 3104
JSONP proxy will only work with JSON
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.
-
27 May 2012 9:57 PM #3
I am also having the option for taking json as a feed in my code with the following changes-
url : 'http://sonewebsite.com/index?page=jsonContent&channel=ALERTS&max=4&view=abc' ,
type : 'json',
But, still its giving me the same issue !
-
28 May 2012 4:13 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
- Answers
- 3104
There is no json proxy. To do cross origin calls you either have to use JSONP proxy (which you must use JSON not XML) or enable CORS and use the ajax proxy
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.


Reply With Quote