これは私のGM_xmlhttpRequestスクリプトです:
// ==UserScript==
// @name test
// @namespace test
// @include http://stackoverflow.com/*
// @version 1
// ==/UserScript==
GM_xmlhttpRequest({
method: "GET",
url: "http://example.com",
onload: function(response) {
alert(response.responseText);
}
});
function begin(){
alert("ready");
}
$(document).ready(function() {
begin();
});
「準備完了」ではなく、example.com の内容のみを警告します。
しかし、私が次のことをしても何も起こりません - アラートはまったくありません:
function begin(){
GM_xmlhttpRequest({
method: "GET",
url: "http://example.com",
onload: function(response) {
alert(response.responseText);
}
});
alert("ready");
}
$(document).ready(function() {
begin();
});
私は何を間違っていますか?