Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6572943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:04:10+00:00 2026-05-25T15:04:10+00:00

function OnSuccessPM(results) { $(#ChatBox).html(); for (var i = 0; i < results.length; i++) {

  • 0
function OnSuccessPM(results) {
            $("#ChatBox").html("");
            for (var i = 0; i < results.length; i++) {
                $("#ChatBox").append(results[i].username + " : " + results[i].message + ". <br />");
            }
            var objDiv = document.getElementById("ChatBox");
            objDiv.scrollTop = objDiv.scrollHeight;
            return false;
    }

MetamorphismApp.ChatService.GetPublicMessages(OnSuccessPM, OnFailurePM);   

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

I get the following error in IE:

length is null or not an object.

What is the solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:04:11+00:00Added an answer on May 25, 2026 at 3:04 pm

    Simplest (but not the best, the best would be to fix what is being passed to your OnSuccessPM function) way would be to check the typeOf the results variable to make sure it is an Array and only proceed to the results.length line if it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm calling a PageMethod in javascript. Like this: function DeleteBatchJS2() {$find('mdlPassword').hide(); var pswd =
I have a JavaScript function for a HTML button click event in aspx page
In my document I have this script: $.ajax({ type:POST,url:ajax.php,data:data, success: function() { //onsuccess },
I have this simple example code: var request = mozIndexedDB.open('MyTestDatabase'); request.onsuccess = function(event){ var
I'm getting Object Error on line function readWURecord() { var ifUSD = ; try
How can I pass parameters to the OnSuccess function of the AjaxOptions class in
When calling an ASP.Net PageMethod, we call it as follows: function doSomething(htmlElement) { PageMethods.GetText(onSuccess,
function returnsAnArray () { return array ('test'); } echo returnsAnArray ()[0]; generates a syntax
Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = connect timeout=9999999; & _
function Submit_click() { if (!bValidateFields()) return; } function bValidateFields() { /// <summary>Validation rules</summary> ///

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.