Jquery html length in IE
<p>I had to made a special advertise module to my friend's site, and our problem is the advertisement doesn't appear in IE.
We send a special code to the advertisement server, and our block is disappeared by default. If we get longer text in $(document).ready, we display the advertisement block.</p>

<p>Our code before loading the page looks like this (I've changed our special numbers to xxx):</p>

<pre><code>&lt;div id="my_ad-0"&gt;
  &lt;div class="content"&gt;
   &lt;div id="bmone2n-xxxxx.x.x.x"&gt;
    &lt;noscript&gt;&lt;div style="display:inline"&gt;&lt;a href="http://go.cz.bbelements.com/please/redirect/xxxxx/x/x/x/"&gt;&lt;img src="http://go.cz.bbelements.com/please/showit/xxxxx/x/x/x/?typkodu=img&amp;keywords=" width="0" height="0" style="border-width:0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/noscript&gt;
   &lt;/div&gt;
 &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>The #my_ad-0 element is dissapeared by default. Then comes the Jquery:</p>

<pre><code>$(document).ready(function() {
 if ($("#my_ad-0").exists()) { //exist is a local function the check this block whether exists
  //alert('text #0: ' + $("#my_ad-0 .content").text().length);
  //alert('html #0: ' + $("#my_ad-0 .content").html().length);
  if ($("#my_ad-0 .content").html().length &gt; 355) {
    $("#my_ad-0").css('display', 'block');
  }
 }
});
</code></pre>

<p>I examine the length of the HTML within #my_ad-0 .content. If it's longer than 355 chars, my block will be appeared (it works in major browsers, Firefox, Opera, Chrome, Safari), but in IE doesn't, because IE says that the length of the block is 55 character. (IE doesn't count the characters within <code>&lt;noscript&gt;</code>) At api.jquery.com I found there is a bug in IE when using html() function, but I don't know how to proceed and solve this problem in IE. Currently I change manually the code to</p>

<pre><code>if ($("#my_ad-0 .content").html().length &gt; 355 || $.browser.msie)
</code></pre>

<p>but it's not to funny :) Any idea?</p>
