EXTjs: how to read rss feed from ashx page to a store ?
I want to get the rss feed of an ashx page to an EXTjs store. It works perfectly with a xml page. but when I test it on an ashx page it doesn't !!!
link: http://met.guc.edu.eg/Feeds/Course.ashx?c=240
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
proxy: {
type: 'ajax',
url: 'http://met.guc.edu.eg/Feeds/Course.ashx?c=240',
reader: {
type: 'xml',
record: 'item',
}
},
fields: ['title','category','pubDateParsed'],
groupField: 'category',
sorters: [{property: 'pubDateParsed', directi开发者_高级运维on: 'DESC'}]
});
Your issue is likely that the browser is preventing you from fetching the feed because of the same origin policy.
With a traditional AJAX call you can only communicate with the site that your page is hosted on (unless you adjust your settings to allow it).
You will either need to setup a proxy page on your site that will fetch and echo the data, or run it through something like Yahoo! Pipes to convert the XML into JSON and use a dynamic script tag, which does not have the same origin policy restrictions.
I think there are some filter, that prevent access.
So, I can ping
met.guc.edu.eg. nslookup
said that met.guc.edu.eg has ip: 62.241.151.180
... but http:/62.241.151.180/Feeds/Course.ashx?c=240
returns 404.
I even cann't connect to it via telnet to get response without browser.
When I try it from ExtJS code I get Error 403.
I think you need to have the proxy as:
proxy: {
type: 'ajax',
url: 'http://met.guc.edu.eg/Feeds/Course.ashx?c=240',
reader: {
type: 'xml',
root: 'channel',
record: 'item'
}
精彩评论