Steps to reproduce.
1) load ajax via .ajax() method
2) put in dom via (id).html(ajax_result);
The following example works:
ajax_result =
<a href="#">hello</a>
<script>
alert('I will execute');
$(document).ready(function(){
$("a").click(function() {alert('hi');});
})
</script>
Howerver, this example does not:
ajax_result =
<div>
<a href="#">hello</a>
<script>
alert('I will execute');
$(document).ready(function(){
$("a").click(function() {alert('hi, but you won\'t see me');});
})
</script>
</div>
Notice that the only difference is that one binding happens inside of a parent element.
I've tested this behavior in IE 7 and FF 2.0.0.8
I'm not sure if this behavior be expected to work as it's generally recommended to leave javascript out of the body of a document however sometimes it's necessary.