JavaScript evaluation in .html() fails occassionally (that too silently)

JavaScript evaluation in .html() fails occassionally (that too silently)

I have JavaScript which I insert in HTML (this is a simplified example):

$('span#footer').html('<b>Hello</b><script type="text/javascript">alert("hi");</script>');

This normally executes perfectly. However, in about 1 out of 20 cases, the JavaScript fails to execute (and there are no errors in console as well). However, I do see the element updated with rest of DOM elements ('Hello' in this case) even when JS fails to execute.

I believe JQuery evals the JavaScript found in html() but why does it fail occassionaly while working perfectly other times. And if it fails, why doesn't DOM insertion fail? What can possibly cause this? Is it a known bug?

This issue is present on all browsers and I use JQuery 1.4.2