HTML5 tags in IE for Dynamic Content (Ajax)
Today I came across the problem for HTML5 tags (nav, header, section etc) which is not working IE version less than 9. I used html5shim to recognize HTML5 tags, But my actual problem was for dynamic content, the dynamic content ( returned by ajax call) which contains HTML5 tags is not rendering by IE properly , and we used HTML5 tags lot of places ,So replacing all tag is tedious , Finally I found the a script innershiv which solved my issue.
Usage:In header include the scripts<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" ></script>
<![endif]-->
<script type="text/javascript" src="/js/innershiv.js"></script>
var s = document.createElement("div");
s.appendChild(innerShiv("<section>Happy section loves CSS. (:</section>"));
document.body.appendChild(s);
Like above code we can use the same for jquery ajax calls, pass extra parameter boolean false while using in jquery to avoid mess up in some situation.
$.ajax({
url: 'test.php',
dataType: "html",
type: "POST",
success: function(html){
$('#test').append(innerShiv(html,false)); }
});

