On Jun 30, 2011, at 12:44 PM, Jonny Nott wrote:
Using html5shiv 1.6.2 (latest) (http://code.google.com/p/html5shiv/)
and Prototype v1.7..
So, html5shiv makes <article>, <section> etc elements work nicely in
IE<9 .. they appear, you can style them etc. All good. The HTML5
elements all exist within the IE DOM tree in Developer Tools.
However, when you try to grab any such HTML5 elements using
Prototype's DOM-traversal methods (e.g. down(), up()), then they
always return undefined in IE8/IE7 (who cares about IE6?). For
example:
<article id="foo">
<div></div>
<section></section>
<ul id="abc123"></ul>
</article>
..then..
var bar = $('foo').down('div'); // works
var baz = $('foo').down('section'); // undefined
..and..
var theArticle = $('abc123').up('article'); // undefined
Is this a gaping hole/bug?
Code to reproduce: http://pastebin.com/TC1Dp5At
Try adding this line in a dom:loaded callback, inside an IE
conditional comment:
$w('article aside details figcaption figure footer header hgroup menu
nav section').each(function(elm){
new Element(elm);
});
As far as I know, IE won't let you script something unless you build
one such in memory first. Once you do that, you're golden. Not sure if
I'm just duplicating what HTML5shiv is supposed to do, but this is the
way I've done it before.
Walter
--
You received this message because you are subscribed to the Google Groups "Prototype
& script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.