所以我有一个包含html代码的页面,我希望greasemonkey用我拥有的另一个HTML代码替换它。怎么做呢?
我有一个例子
<html>
<body>
<h1>Cajuda</h1>
<p>Oliveira da serra</p>
<p>Oliveira da serra</p>
<p>Oliveira da serra</p>
<p>Oliveira da serra</p>
<p>Lagarta maritima</p>
</body>
</html> 我想在这方面做一些改变:
<html>
<body>
<td title="7885" nowrap="nowrap">Ovar</td>
<td> </td>
<td title="Online" align="center" bgcolor="#ff8288">H</td>
<td title="Offline" align="center" bgcolor="#88ff88">1</td>
<td> </td>
</body>
</html> 发布于 2009-07-23 19:18:32
这里有一个关于How to write Greasemonkey scripts的教程的链接。
发布于 2009-07-23 19:19:25
从greasemonkey manual
var theImage, altText;
theImage = document.getElementById('annoyingsmily');
if (theImage) {
altText = document.createTextNode(theImage.alt);
theImage.parentNode.replaceChild(altText, theImage);
}其余的可以在here上找到。
https://stackoverflow.com/questions/1173892
复制相似问题