i have one solution for you.
You can return result as JSON
example
{ javascript: 'script content', html: 'html' }
and when you receive response you can execute script, but first of all you need to append you html than call script, reason for this is because script might need something from returned HTML
You can execute your script like this
var s = 'alert("senad");';
s += 'alert("meskin");';
s += 'var a = 10; var b = 13;';
s += 'var c = a+b;';
s +='alert(c);'
eval(s);
Full example:
$.post('/info/getinfo/',
{
mode: 'sample of sending var trough post',
}, function(data){
$('#targetdiv').html(data.html);
eval(data.javascript);
}, 'json');
or you can create custom javascript that will be executed when loading is done.