Sunday, November 20, 2011

HTML5 for IE

Cross Browser Compatibility of HTML5 code for Internet Explorer


For everyone’s convenience, A single JavaScript file that can be included to create all the HTML 5 elements (and the <abbr> element) for IE.



// save the below code as html5.js

(function()
{if(!/*@cc_on!@*/0)
return;
var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(',');
for(var i=0;i<e.length;i++)
{document.createElement(e[i])}})()
// end //
Include the script in your <head> tag, and you’ll be able to style the elements appropriately in IE:
<!--[if lte IE 8]>
<script src="html5.js" type="text/javascript"></script>
<![endif]-->
<a href="http://directory.askbee.net" id="R72EAB8">Askbee directory</a>


No comments:

Post a Comment