• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 21 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0032 秒)

1. HttpRequest感觉没有发成功 [ 100%]

...a.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.on(Event.PROGRESS,this,processHandler); xhr.send("https://www.baidu.com","","get","text"); function processHandler(data){ console.log(data); c...

来源: Laya_社区 发布时间: 20180827

2. 最新版本IDE,如何获取http返回的json数据 [ 99%]

...a.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.once(Event.PROGRESS,this,processHandler);  var sendData = {account:"aaa",password:"bbb"} xhr.send("http://xxx/login", JSON.stringify(sendData...

来源: Laya_社区 发布时间: 20180824

3. xhr的on和once什么区别,官网例子 [ 98%]

...w HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.on(Event.PROGRESS,this,processHandler); 2017-10-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: ...

来源: Laya_社区 发布时间: 20171017

4. Laya.HttpRequest 没有调用回调方法? [ 90%]

...a.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.on(Event.PROGRESS,this,processHandler); xhr.send("https://www.baidu.com/","","get","text"); function processHandler(data){ console.log(data); ...

来源: Laya_社区 发布时间: 20180830

5. 排坑:Laya.HttpRequest()无效 [ 88%]

...a.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE, this, completeHandler); xhr.once(Event.ERROR, this, errorHandler); xhr.on(Event.PROGRESS, this, processHandler); xhr.send("http://www.baidu.com", "", "get", "text"); function processHandler(data) { console.log...

来源: Laya_社区 发布时间: 20180208

6. 二进制图片(ActionScript-2D进阶篇(AS3)-游戏加载策略) [ 87%]

...代码如下: ```java package { import laya.display.Sprite; import laya.events.Event; import laya.net.HttpRequest; import laya.utils.Browser; public class LayaSample { public function LayaSample() { //初始化引擎 Laya.init(1136, 640); var sp:Sprite = new Sprite(); var xhr:HttpRequest = new Htt...

来源: Laya2.0_文档 发布时间: 20210714

7. 官方的示例贴上来,怎么没反映啊 [ 87%]

...a.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE, this, completeHandler); xhr.once(Event.ERROR, this, errorHandler); xhr.on(Event.PROGRESS, this, processHandler); xhr.send("https://api.weixin.qq.com/cgi- ... ot%3B, "", "get", "text"); function processHandler(...

来源: Laya_社区 发布时间: 20180419

8. 求解关于跨域的具体操作 [ 86%]

...tHeader('Content-Type','application/x-www-form-urlencoded'); xhr.once(Laya.Event.COMPLETE, this, this.completeHandler, [url, loader]); xhr.once(Laya.Event.ERROR, this, this.errorHandler); console.log("-----------------send------------------", url); xhr.send(url, "", "get", "arraybuffer"); 2018-07-04...

来源: Laya_社区 发布时间: 20180704

9. 二进制图片(JavaScript-2D进阶篇(JS)-游戏加载策略) [ 85%]

...ar sp = new Laya.Sprite(); var xhr = new Laya.HttpRequest(); xhr.once(Laya.Event.COMPLETE,this,completeHandler); xhr.once(Laya.Event.ERROR,this,errorHandler); xhr.send("res/monkey2.png","","get","arraybuffer"); function completeHandler(data){ //加载完成返回的data是arraybuffer; //.......这...

来源: Laya2.0_文档 发布时间: 20210715

10. 二进制图片(TypeScript-2D进阶篇(TS)-游戏加载策略) [ 84%]

...ar sp = new Laya.Sprite(); var xhr = new Laya.HttpRequest(); xhr.once(Laya.Event.COMPLETE,this,this.completeHandler); xhr.once(Laya.Event.ERROR,this,this.errorHandler); xhr.send("res/a.png","","get","arraybuffer"); } private completeHandler(data:Object):void{ //加载完成返回的data是arraybuffe...

来源: Laya2.0_文档 发布时间: 20210714