/**
* 网络请求过关
**/
gameover:function(url){
var self =
this ;
var xhr = cc.loader.getXMLHttpRequest();
xhr.open(
"GET", url);
xhr.setRequestHeader(
"Content-Type",
"text/plain;charset=UTF-8");
xhr.onreadystatechange = function () {
if (xhr.readyState ==
4 && (xhr.status >=
200 && xhr.status <=
207)) {
var response = xhr.responseText;
var jsonData = JSON.parse(response);
var code = jsonData[
"code"];
if(code ==
1){
self.successSprite.getComponent(cc.Animation).play(
'resAnimate');
}
}
};
xhr.send();
},
转载请注明原文地址: https://ju.6miu.com/read-1123440.html