Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
Created July 23, 2009 08:48
Show Gist options
  • Save alvin2ye/152547 to your computer and use it in GitHub Desktop.
Save alvin2ye/152547 to your computer and use it in GitHub Desktop.
Ext.data.ScriptTagProxy 跨域访问
var ds = new Ext.data.Store({
proxy: new Ext.data.ScriptTagProxy({
url: 'http://extjs.com/forum/topics-remote.php'
}),
reader: new Ext.data.JsonReader({
root: 'topics',
totalProperty: 'totalCount',
id: 'post_id'
}, [
{name: 'title', mapping: 'topic_title'},
{name: 'topicId', mapping: 'topic_id'},
{name: 'author', mapping: 'author'},
{name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
{name: 'excerpt', mapping: 'post_text'}
])
});
ds.load();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment