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

大约有 15 项符合查询结果, 库内数据总量为 30,903 项。 (搜索耗时: 0.0027 秒)

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

xhr的on和once什么区别,官网例子 Laya.init(1136, 640); var xhr:HttpRequest = new 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 ...

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

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

...tonLogin = function (){ console.log ('按了登录按钮')  var xhr = new Laya.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 = {acco...

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

3. HttpRequest感觉没有发成功 [ 97%]

...输出。是不是我哪里用得不对?代码如下 //初始化引擎 Laya.init(1136,640); var xhr = new Laya.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.on(Event.PROGRESS,this,processH...

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

4. 求解关于跨域的具体操作 [ 88%]

...lication/json"); 还是说用参考代码里的HttpRequest() var xhr = new Laya.HttpRequest(); xhr.http.setRequestHeader('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);...

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

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

排坑:Laya.HttpRequest()无效 写了一个测试程序,简单获取网页源码并打印到控制台。然而,什么也获取不到 下面是代码 console.log("开始测试"); var xhr = new Laya.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE, this, co...

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

6. Laya.HttpRequest 没有调用回调方法? [ 86%]

Laya.HttpRequest 没有调用回调方法? //初始化引擎 Laya.init(1136,640); var xhr = new Laya.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.on(Event.PROGRESS,this,processHandler); ...

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

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

...= (function (_super) { function JiHuo() { JiHuo.super(this); var xhr = new Laya.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://...

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

8. 请问怎么把arraybuffer作为图片显示出来 [ 83%]

...必须用这种方式显示图片   之前有在网上看到  let url = Laya.Browser.window.URL.createObjectURL(data);  这样把arraybuffer弄成一个url   但是这种方式估计在微信小游戏或其他平台不行的   求大神帮忙 let xhr = new Laya.HttpRequest(); xhr.once(Laya.Eve...

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

9. web和微信端没有问题,打包成apk后 httprequest报Request failed Status:404 text:undefined [ 80%]

...容相关的链接 提交 2 个回复 金风 赞同来自: this.xhr.once(Laya.Event.COMPLETE, this, this.CompleteHandler); this.xhr.once(Laya.Event.ERROR, this, this.ErrorHandler); this.xhr.on(Laya.Event.PROGRESS, this, this.ProgressHandler); this.xhr.send(Global.WebHost+this.currentRequest.url, thi...

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

10. httpRequest send返回Request failed Status:0 [ 77%]

...一玩处取排行榜时返回的用户头像URL 代码如下 var WebGL = Laya.WebGL; // 程序入口 var GameMain = /** @class */ (function () { function GameMain() { //初始化引擎 Laya.init(1136, 640); for (var i = 0; i < 4; i++) { var sp = new Laya.Sprite(); var xhr = new Laya.HttpRequest(...

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