I get an error (Object doesn't support this property or method) on 56. In Internet Explorer and I would like to try to keep it cross browser compatible.


This is the source of the function:

SM.Util.prototype.constructor.Notify = function(txt) {
chat = document.getElementById('chat'); //this is line 56 and chat is a img
notify = document.getElementById('notify');
notify.style.left = leftValue;
notify.style.visibility = "visible";
notify.innerHTML = txt;
setTimeout("SM.Util.Notify.Clear()",5000);
}

I get an error (Object doesn't support this property or method) on 56. In Internet Explorer and I would like to try to keep it cross browser compatible.


This is the source of the function:

SM.Util.prototype.constructor.Notify = function(txt) {
chat = document.getElementById('chat'); //this is line 56 and chat is a img
notify = document.getElementById('notify');
notify.style.left = leftValue;
notify.style.visibility = "visible";
notify.innerHTML = txt;
setTimeout("SM.Util.Notify.Clear()",5000);
}

There's nothing wrong with the line you refer to as being 56th; (that is: the one causing the error). Because it can't!
You didn't declare your "chat" variable before using but that's not gona cause errors.

If you are using linked content and scripts on that page, IE will report wrong line of error. Or the correct one but-referring to what document -I don't know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.