#198 √ resolved
John-David Dalton

Selector.handlers.id() can remove the browser sniff for IE and Opera

Reported by John-David Dalton | July 1st, 2008 @ 07:12 AM | in 1.6.0.3

The browser sniff for IE and Opera is kind of silly (it appears the only browser that doesn't exhibit this behavior is Safari (at least 3.1 on windows).

The behavior is document.getElementById('foo') not finding element with the ID "foo" if it's not attached to the document.

So I removed the sniff in favor of this.

  var needsToSearch = root === document || root.sourceIndex < 1 ||
    !Element.descendantOf(root, document.documentElement);

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Tags