Created
June 16, 2014 10:10
-
-
Save oleq/4456298a5f3cbc1e28cd to your computer and use it in GitHub Desktop.
This is how IE8 plays with <object> (document#querySelector, element#childNodes)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>IE8 rocks!</title> | |
</head> | |
<body> | |
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"> | |
<param name="allowFullScreen" value="false" /> | |
<param name="quality" value="high" /> | |
<param name="movie" value="foo.swf" /> | |
<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="foo.swf" quality="high" allowfullscreen="false"> </embed> | |
</object> | |
<script> | |
var object = document.querySelector( 'object' ), | |
param = object.querySelector( 'param' ), | |
embed = object.querySelector( 'embed' ); | |
console.log( 'object: ', object ); | |
console.log( 'param: ', param ); | |
console.log( 'embed: ', embed ); | |
var objectChildren = object.childNodes; | |
for ( var i = 0; i < objectChildren.length; i++ ) { | |
if ( objectChildren[ i ].nodeType == 1 ) | |
console.log( 'object > ', objectChildren[ i ].outerHTML ); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment