Chat application JS problems

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Chat application JS problems

Post by Todd_Z »

Code: Select all

Error: uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame :: http://chatlance.com/Scripts/ConversationJS.php?rm=5 :: updateConv :: line 25"  data: no]
I'm working on a chat application similiar to scrotaye's - but mine involves password protected chatrooms, and lots of them. Anyways, in opera and ie, the application works pretty well. I'm sure it'll start getting crappy when the conversation gets bigger [each conversation has its own text file] But the problem at the moment is that in firefox i get the error above. Any ideas on how to fix that problem?

http://chatlance.com/Scripts/ConversationJS.php?rm=5:

Code: Select all

function checkKey ( evt ) {
	if ( evt.keyCode == 13 ) {
		writeToConversation( document.conv.msg.value );
		document.conv.msg.value = '';
	}
}

xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");

function writeToConversation ( msg ) {
	url = "/Scripts/Conversation.php?c=5&m=" + msg;
	xmlhttp.open("GET", url,true);
	xmlhttp.send(null)
}

function updateConv ( ) {
	xmlhttp.open("GET", "/Scripts/Conversation.php?c=5",true);
	xmlhttp.onreadystatechange=function() {
		if ( xmlhttp.readyState == 4 ) {
			i = document.getElementById( 'convo' );
			i.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null)
	setTimeout( "updateConv()", 250 );
}

updateConv();
Post Reply