jsonp

前端之家收集整理的这篇文章主要介绍了jsonp前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
        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:"俄罗斯"}
]})

猜你在找的Json相关文章