模块中的Ajax错误:对象的状态必须为OPENED

Mdd*_*Mdd 0 javascript ajax

我试图在没有首次使用jQuery的情况下向模块添加ajax方法.我在我的方法上遇到以下错误.jax():Uncaught InvalidStateError:无法在'XMLHttpRequest'上执行'send':对象的状态必须是OPENED.

我不知道如何解决这个问题.这是我的模块和一些简单的HTML.

var Test = (function (el) {

  function InnerTest () {
    this.el = el;

    //Capital letters indicate a constant that should not change.
    this.PARA = 'p'

    this.init();       
  };

  InnerTest.prototype.init = function () {
    this
        .createChildren()
        .runIt()
        .jax();
  };

  InnerTest.prototype.createChildren = function () {
    this.para = this.el.querySelectorAll(this.PARA); 

    return this;
  };

  InnerTest.prototype.runIt = function () {
    var len = this.para.length;
    for (var i = 0, item; item = this.para[i]; i++) {
        //test if browser supports the classList method else use className to add class.
        if (item.classList) {
            item.classList.add(item.textContent)
        }
        else {
          item.className += ' ' + item.textContent
        }
        console.log( item );
        console.log( item.classList );
    }

    return this;
  };

  InnerTest.prototype.jax = function () {
    var self;
    var request = new XMLHttpRequest();
    request.open = ('GET', 'https://api.github.com/users/xxxxxxxxx', true);

    request.send();

    request.onload = function () {

        data = JSON.parse(this.reponse);
        console.log( data );
    };

    return this;
  };

  return InnerTest;

}( document.querySelector('.box') ));

(function () {
  new Test();
}());
Run Code Online (Sandbox Code Playgroud)

这是HTML:

<div class="box">
  <p>One</p>
  <p>Two</p>
  <p>Three</p>
</div>
Run Code Online (Sandbox Code Playgroud)

epa*_*llo 7

open是一种方法,而不是属性

request.open = ('GET', 'https://api.github.com/users/xxxxxxxxx', true);
            ^^^
Run Code Online (Sandbox Code Playgroud)

应该

request.open('GET', 'https://api.github.com/users/xxxxxxxxx', true);
           ^^^
Run Code Online (Sandbox Code Playgroud)