jQuery.html filters scripts?

jQuery.html filters scripts?

Two problems I noticed I think its the jQuery.html causing these:

I load AJAX content into a div in the
$('#div_id').html(newcontent)
style.

In the original AJAX response, in detail the Inviter component from facebook,
the
<script type="text/fbml"></script>
block is child of:
<fb:serverfbml></fb:serverfbml>


After putting this into the div using the jQuery.html() the fbml script is placed at the end of the target div and the Inviter is not showing any friends from facebook. My workaround is to set a id to the
<fb:serverfbml id="fbmltag">
and to build the fbml script block manually in JavaScript and append it as a child to the <fb:serverfbml>tag.

Is there something to know about jQuery.html()? Does this method filter or sort the html he inserts?

Second problem is strange:

In the AJAX response I have a javascript with a try/catch block. When inserting the response with jQuery.html() the browser gives me an javascript error "unterminated string literal" even if the causing line is a comment!!!

The complete javascript:
01 try {
02    var fbml_script_tag = document.createElement('script');
03    var fbml_script_type_attr = document.createAttribute('type');
04    fbml_script_type_attr.nodeValue = 'text/fbml';
05    fbml_script_tag.setAttributeNode(fbml_script_type_attr);
06    fbml_script_tag.innerHTML = '[ ... script content ... ]'
07    document.getElementById('fbmltag').appendChild(fbml_script_tag);
08 } catch(e) {
09    for (i in e)
10       msg += i + ': ' + e[i] + '\n';
11    console.info(msg);
12 }


The "unterminated string literal" error occours in line 10.
hardcoded this script works fine. Placed with jQuery.html it throws the
javascript error. Note: this Javascript error is not the one it catches in
the script in line 8! the script is not executed! Even when i comment out line 10 like this:
// msg += i + ': ' + e[i] + '\n';
the browser tells me the same unterminated string literal error...

Why???

Is there anybody understanding this?

Thanks,

Robert from Austria