Cocos creator引擎可以通过以下方式请求数据,兼容所有平台
var that =this
let xhr = new XMLHttpRequest();
         xhr.onreadystatechange = function () {
                   if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
                            var response = xhr.responseText;
                            var data = JSON.parse(response).data;
                            console.log(data)  
                   }
         };
         xhr.open("GET", 'https://game.exame.top/index/Index/score', true);
         xhr.send();
                
                          
                          
                        
                        
                        
                        
                        
                        
                        
                        
                
                
                        
                        
                        
                        
关于简忆
简忆诞生的故事
            


粤ICP备16092285号
文章评论(0)