鍍金池/ 問答/HTML5  HTML/ js,dispatchLoad() 后,onload()不執(zhí)行???

js,dispatchLoad() 后,onload()不執(zhí)行???

  • 代碼如下:
  request.onload = function (s) {
    splash.style.display = 'none';
    stage = s;
    layout();

    s.isTurbo = turbo;
    s.start();
    s.triggerGreenFlag();

    player.appendChild(s.root);
    s.focus();
    s.handleError = showError;
  }
 
 Request.prototype.load = function(result) {
    request.addEventListener('load', this.update);
    this.result = result;
    this.isDone = true;
    this.dispatchLoad(result);
  };
  • 我打印dispatchLoad()已經(jīng)執(zhí)行,但是在onload console.log()卻沒有輸出,另外dispatchProgress主動(dòng)執(zhí)行后,onprogress()卻可以,代碼沒有任何報(bào)錯(cuò)。
  • 這塊是phosphorus 一個(gè)在h5頁面加載scratch2.0 文件的js 解釋器.
  • 我是按著網(wǎng)易咔噠做的like 栗子
  • 補(bǔ)圖,主動(dòng)加載沒問題,打印的全是對(duì)象,onload方法里console.log(1) 卻打印不出來
    圖片描述
  • so,why,why,why????
回答
編輯回答
嫑吢丕

謝邀

request.addEventListener('load', this.update);

這句的request是什么東西???

2017年1月15日 08:13