[Greasemonkey] Patterns

Prakash Kailasa pk-moz at kailasa.net
Thu Apr 14 15:08:28 EDT 2005


On Thu, Apr 14, 2005 at 01:08:39PM -0400, Mark Pilgrim wrote:
> On 4/14/05, Edward Lee <edilee at gmail.com> wrote:
> > On 4/12/05, Mark Pilgrim <pilgrim at gmail.com> wrote:
> > > - Replace an existing element
> > >
> > > existingElement.insertBefore(newElement, existingElement);
> > > existingElement.parentNode.removeChild(existingElement);
> > 
> > Is there a reason why one wouldn't use
> > 
> > existingElement.parentNode.replaceChild(newElement, existingElement);
> 
> Because I didn't know about it until now.  (I swear, I learn something
> new every day on this list.)

Jesse Ruderman's Javascript Shell bookmarklet
(http://www.squarefree.com/shell/) has been invaluable to me, not only
in experimenting with Javascript, but also in figuring out DOM objects
(I am specifically talking about the 'props' function, which displays
the information about any object).

/prakash

-- 
|Never put off till run-time what you can do at compile-time.          |
|                -- D. Gries                                           |


More information about the Greasemonkey mailing list