Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED

代码

function b(mp4url, title_9) {
  let c = document.createElement('div')
  c.setAttribute('class', 'xiazai')
  c.innerHTML = '下载'
  document.body.appendChild(c)
  c.addEventListener('click', function d(mp4url, title_9) {
    console.log(window.XMLHttpRequest);
    var xhr = null
    xhr = new XMLHttpRequest()
    xhr.responseType = 'blob'
    xhr.onreadystatechange = function (e) {
      let url9 = URL.createObjectURL(e)
      let a = document.createElement('a')
      a.href = url9
      a.download = title_9 + '.mp4'
      a.click()
      a.remove()
    }
    console.log(xhr);
    xhr.open = ("get", mp4url, true)
    console.log(xhr);
    xhr.send(null)
  })
}

报错

img


Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.

xhr.open后面调整下,好像多了个=