Page 1 of 1

Javascript functions named remove in google chrome

Posted: Thu Jan 24, 2013 6:56 pm
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.

Re: Javascript functions named remove in google chrome

Posted: Mon Feb 11, 2013 5:01 pm
by jraede
Thanks, that would have driven me nuts.

Re: Javascript functions named remove in google chrome

Posted: Tue Feb 12, 2013 5:38 pm
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?