私はグリースモンキーのGM_xmlhttpRequest()
とGET
要求発射しています:Greasemonkey AJAXリクエストはデータを送信していませんか?
<?php
print_r($_REQUEST);
print_r($_GET);
echo "Hello friends".$_GET['vid'];
?>
$_REQUEST
=>はWordPressに関連するいくつかのデータを返します。
$(".getReview").click(function(){
var videoId = $(this).parents("li").find("a").attr("href");
alert(videoId);
GM_xmlhttpRequest({
method: "GET",
url: "http://www.amitpatil.me/demos/ytube.php",
data: "username=johndoe&password=xyz123",
headers: {
"User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used.
"Accept": "text/xml" // If not specified, browser defaults will be used.
},
onload: function(response) {
console.log(response);
}
});
、ここでは、サーバコードytube.phpです。 $_GET
=>空白の配列を返します。
何が間違っているかわかりません。私もPOST
メソッドを試しました。