簡體   English   中英

HBBTV 1.1.1 xmlhttprequest.responseURL

[英]HBBTV 1.1.1 xmlhttprequest.responseURL

我需要在 vaniliaJS 中為 hbbtv 1.1.1(版本瀏覽器 Opera 12.11)獲取 xmlhttprequest.responseURL。 有誰知道答案嗎?

我不熟悉該版本的HbbTV標准,但是如果兼容設備支持,則MDN上文檔應該是正確的。

如果您需要XMLHttpRequest()中的響應,那么答案是:

try{
  var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      if (this.readyState == 4 && this.status == 200) {
       //do something here if you want
      }
    };
    xhttp.open("GET", URL, true); //true for synchronous and false for asynchronous
    xhttp.send();  
} catch (error){
//do something with the error
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM