var newScript = document.createElement(‘script‘); newScript.setAttribute("src","http://192.168.255.14:8546/countrys_p.txt"); newScript.setAttribute("type","text/javascript"); function callback(data) { grid.setData(data.data); };
countrys_p.txt的内容
callback({total:11,data:[ {url:"BE.ico",name:"比利时"},{url:"CZ.ico",name:"捷克"},{url:"DE.ico",name:"德国"},{url:"DK.ico",name:"丹麦"},{url:"ES.ico",name:"西班牙"},{url:"GB.ico",name:"英国"},{url:"GR.ico",name:"希腊"},{url:"HR.ico",name:"克罗地亚"},{url:"IS.ico",name:"冰岛"},{url:"IT.ico",name:"意大利"},{url:"RU.ico",name:"俄罗斯"} ]})