1
Google 크롬 앱에서 웹 JS API를 요청하는 방법은 무엇입니까? Google 크롬 앱의 초보자이기 때문에 좋은 예도 있습니다.Google 크롬 앱에서 JSON을 POST하는 방법은 무엇입니까?
중복 퀘스트 인 경우 답변 링크에 의견을 남기십시오.
감사합니다.
Google 크롬 앱에서 웹 JS API를 요청하는 방법은 무엇입니까? Google 크롬 앱의 초보자이기 때문에 좋은 예도 있습니다.Google 크롬 앱에서 JSON을 POST하는 방법은 무엇입니까?
중복 퀘스트 인 경우 답변 링크에 의견을 남기십시오.
감사합니다.
AJAX에서와 마찬가지로 XMLHttpRequest 개체입니다.
function log(message) {
var client = new XMLHttpRequest();
client.onreadystatechange = function() {
// in case of network errors this might not give reliable results
if(this.readyState == this.DONE)
console.log("log entry sent with status: " + this.status);
}
client.open("POST", chrome.extension.getURL("/log"), true);
client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
client.send(message);
}
: 참조 여기
Cross-Origin XMLHttpRequest
에서 봐 주시기 바랍니다 것은 w3c.org에서 예제