Hi,
I'm using the following code in a Greasemonkey script.
var start, newElement;
start = document.body;
newElement = document.create Element('b');
newText = document.create TextNode("The Greasemonkey salutes you!");
newElement.appe ndChild(newText );
start.appendChi ld(newElement);
Can anyone tell me: 1) why my string appears twice; 2) how to make it
appear just once?
I'm trying to insert code at the top of every viewed page. Obviously,
document.body appends the string to the closing body tag which is not
what I want. What could I use to insert my code as the first childnode
under 'body'?
Thanks.
I'm using the following code in a Greasemonkey script.
var start, newElement;
start = document.body;
newElement = document.create Element('b');
newText = document.create TextNode("The Greasemonkey salutes you!");
newElement.appe ndChild(newText );
start.appendChi ld(newElement);
Can anyone tell me: 1) why my string appears twice; 2) how to make it
appear just once?
I'm trying to insert code at the top of every viewed page. Obviously,
document.body appends the string to the closing body tag which is not
what I want. What could I use to insert my code as the first childnode
under 'body'?
Thanks.
Comment