解决方案 »

  1.   

    getJsonByURL:function(type,url,nickName,returnFun){            var xhr = cc.loader.getXMLHttpRequest();            xhr.open(type, url);
                xhr.onreadystatechange = function () {
                    if (xhr.readyState == 4 && xhr.status == 200) {
                     
                        returnFun(xhr.response);
                    }
                };
    }
    //使用方法
    xxx.getJsonByURL(type,url,nickName,function(str){
    alert(str);//这里获取回调结果})