0

So I have this page with the html code and I want greasemonkey to replace it by another HTML code that I have. How can it be done ?

exemple I have

<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> 

and I want to transform in this :

    <html>
<body>
<td title="7885" nowrap="nowrap">Ovar</td>
<td>&nbsp;</td>
<td title="Online" align="center" bgcolor="#ff8288">H</td>
<td title="Offline" align="center" bgcolor="#88ff88">1</td>
<td>&nbsp;</td>

</body>
</html> 
4

2 回答 2

1

Here's a link to tutorials on How to write Greasemonkey scripts.

于 2009-07-23T19:18:32.047 回答
1

From the greasemonkey manual:

var theImage, altText;
theImage = document.getElementById('annoyingsmily');
if (theImage) {
    altText = document.createTextNode(theImage.alt);
    theImage.parentNode.replaceChild(altText, theImage);
}

The rest is available here.

于 2009-07-23T19:19:24.557 回答