jQuery. Prepend with fadeIn (error)
<p>I've used code from here <a href="http://stackoverflow.com/questions/1906066/jquery-prepend-fadein">jquery prepend + fadeIn</a></p>

<p>Without <code>fadeIn</code> it works</p>

<pre><code>function updateResult(data) {
$('#test').prepend(
    html
);
}
</code></pre>

<p>But with <code>fadeIn</code> works only when data contains one <code>div</code> tag, </p>

<pre><code>$('#test').prepend(
    $(html).hide().fadeIn('slow')
);
</code></pre>

<p>otherwise FireFox returns error </p>

<pre><code>uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://code.jquery.com/jquery-latest.min.js :: &lt;TOP_LEVEL&gt; :: line 16" data: no]
</code></pre>

<p>How it possible rewrite this code?</p>

<p><strong>Upd.</strong>
In my situation I've solved it this way </p>

<pre><code>data = data.replace(/(?:(?:\r\n|\r|\n)\s*)/gi, '');
$(data).hide().prependTo('#test').fadeIn('slow');
</code></pre>

<p>After removing line breaks works as should</p>
