Javascript functions named remove in google chrome

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Javascript functions named remove in google chrome

Post by s.dot »

Apparently, with the latest updates, chrome has implemented it's own native remove() function, which will be called instead of one you may have named remove(). I spent a good while debugging this, so am making this post to inform people and so it can show up in the search engines when people search for it.

It has been detailed here:
http://code.google.com/p/chromium/issue ... ?id=170395

And found here:
http://dom.spec.whatwg.org/#dom-childnode-remove

The (perhaps temporary) solution.. rename your remove() function or encapsule it in a namespace.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: Javascript functions named remove in google chrome

Post by jraede »

Thanks, that would have driven me nuts.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Javascript functions named remove in google chrome

Post by pickle »

What I don't get is why user code doesn't overwrite the function? If you declare a function alert() for example, it gets called instead of the native alert() function - why is remove() different?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply