Re: Selectors API: Multiple elements with the same ID

On Sun, 28 Jan 2007 23:58:51 +0100, Maciej Stachowiak <mjs@apple.com>  
wrote:
> I tried to make some test cases to figure out the difference (in current  
> WebKit sources we changed to return the first match in document order to  
> match IE, and, we thought, Firefox), but Gecko's getElementById seems to  
> be really buggy. For instance, this alerts null:
>
> <div id="foo">
> </div>
> <script>
> alert(document.getElementById("foo"));
> </script>
>
> This is with Firefox 2.0.0.1 on Mac OS X. What am I doing wrong here?

I suspect that's the parsing bug where <script> is moved to <head> because  
no significant content has occured yet (I'm not entirely sure how that  
works or is determined).


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Sunday, 28 January 2007 23:05:29 UTC