使用Ext跨域载入外网信息

代码
  1. Ext.onReady(function () {
  2.     Ext.data.JsonP.request({
  3.         url: 'http://smart-ip.net/geoip-json',
  4.         success: function (data) {
  5.             Ext.getCmp("lb_weather").setText(data.city);
  6.         },
  7.         failure: function (d) {
  8.             Ext.getCmp("lb_weather").setText("获取城市失败!");
  9.         }
  10.     })
  11. })
posted @ 2013-04-02 17:07  商银达Ext.net  阅读(174)  评论(0)    收藏  举报