Reputation:
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> </td>
<td title="Online" align="center" bgcolor="#ff8288">H</td>
<td title="Offline" align="center" bgcolor="#88ff88">1</td>
<td> </td>
</body>
</html>
Upvotes: 0
Views: 518
Reputation: 28409
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.
Upvotes: 1
Reputation: 564413
Here's a link to tutorials on How to write Greasemonkey scripts.
Upvotes: 1