我想用Greasemonkey自动更改(文本名称)。
例如,我希望看到“假”而不是“拳击”和“Kickbox”。
< text >Boxing< /text >
= < text >false< /text >
< text >Kickbox< /text >
= < text >false< /text >
< text >Football< /text >
= < text >true< /text >
我想更改此代码:
< questions >
< question id="5" >
< text >Which is playing with ball ?< /text >
< answer id="10" >
< text >Boxing< /text >
< /answer >
< answer id="11" >
< text >Football< /text >
< /answer >
< answer id="12" >
< text >Kickbox< /text >
< /answer >
< /question >
< /questions >
答案 0 :(得分:1)
尽我可以解释这个问题(请澄清并链接到实际页面或实际页面的pastebin,这是一个更改这些值的完整脚本:
// ==UserScript==
// @name _Automatically change answer text
// @include http://YOUR_SERVER/YOUR_PATH/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// ==/UserScript==
changeAnswerText ("Boxing", "false");
changeAnswerText ("Kickbox", "false");
function changeAnswerText (oldText, newText) {
//-- oldText is case-sensitive.
var answers = $("questions answer text:contains('" + oldText + "')");
answers.text (newText);
}