我目前正在研究 GM_getvalue 但它只將數據保存在本地存儲中。我想將輸入的值保存到 send.php 所在的服務器。這是我的代碼:var $ = unsafeWindow.jQuery;$(document).ready(function() { if($("#save_form").html()){ $("#save_form").submit(function(){ var fullname = $("#name").val(); var IDnumber = $("#id").val(); GM_setValue("attendancelogs",GM_getValue("attendancelogs","")+fullname+" "+IDnumber+"<br/>"); }); }有人建議我使用 GM_xmlhttpRequest 但我不知道如何使用它。他告訴我 GM_xmlhttpRequest 看起來像這樣:jQ(document).on("keyup", "form input", function () { let value = GM_getValue("name_full",""); GM_xmlhttpRequest({ method: "POST", url: "http://....", data: value, headers: { "Content-Type": "application/x-www-form-urlencoded" }, onload: function(response) { alert(response); var json = $.parseJSON(response); } });最后,send.php 代碼是什么?
是否可以使用greasemonkey/tampermonkey 將GM_xmlhttpRequest
桃花長相依
2022-05-22 16:11:06