Skip to content

Instantly share code, notes, and snippets.

@oleq
Created June 16, 2014 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleq/4456298a5f3cbc1e28cd to your computer and use it in GitHub Desktop.
Save oleq/4456298a5f3cbc1e28cd to your computer and use it in GitHub Desktop.
This is how IE8 plays with <object> (document#querySelector, element#childNodes)
<!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