Javascript error in IE
<pre><code>function OnSuccessPM(results) {
            $("#ChatBox").html("");
            for (var i = 0; i &lt; results.length; i++) {
                $("#ChatBox").append(results[i].username + " : " + results[i].message + ". &lt;br /&gt;");
            }
            var objDiv = document.getElementById("ChatBox");
            objDiv.scrollTop = objDiv.scrollHeight;
            return false;
    }

MetamorphismApp.ChatService.GetPublicMessages(OnSuccessPM, OnFailurePM);   

[WebMethod(EnableSession = true)]
        public List&lt;Message&gt; GetPublicMessages()
        {
            List&lt;Message&gt; getMsgsList = (List&lt;Message&gt;)HttpContext.Current.Application["Messages"];
            return getMsgsList;
        }
</code></pre>

<p>I get the following error in IE:</p>

<blockquote>
  <p>length is null or not an object.</p>
</blockquote>

<p>What is the solution?</p>
