'null' is null or not an object error on javascript

I've successfully set up Chat (http://www.ebrueggeman.com/phpsimplechat/index.php)
On Firefox and Google Chrome it works fine without errors, but with MSIE6,7 it complains:
'null' is null or not an object error on javascript , about this function

function user_active_ajax(myvar) {
      var chatusers = document.getElementById('div_chat_users');
      var currentuser = document.getElementById('div_current_user');
      //JS Logic
      var messageArray = myvar.split(',');
      var resultHTML='';

      for (var i=0; i < messageArray.length; i++) {
            resultHTML = resultHTML      + (messageArray[i]+'<br/>')
      chatusers.innerHTML = resultHTML; <------------------------------------ error line

from ajax/functions.js

Who is Participating?
mverschoofConnect With a Mentor Commented:
is the script loaded before the div (div_chat_users)? If so, it doesn't know where to place the innerHTML code

Hope this helps
priya_patilConnect With a Mentor Commented:
if the error line is thid than this means that
var chatusers = document.getElementById('div_chat_users'); returns null
IE7 is not able to find any div with id "div_chat_users"
tomzuAuthor Commented:
That partly solved my problem. Is anyone willing to help more?

This is example page of chat script http://www.ebrueggeman.com/phpsimplechat/examples.php

If I use MSIE, after I post a message, all messages dissapear. When you post again, they show up for some time (~2sec) then dissapear again.
tomzuAuthor Commented:
Solved by myself :)
David S.Commented:
For anyone who finds this later, would you please tell us what the problem turned out to be and what your solution was?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.