By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

Exception in chatting application in Firefox

P: 6
i am getting exception like this---
1.
[Exception... "Component returned failure code: 0x804b000f [nsIXMLHttpRequest.setRequestHeader]" nsresult: "0x804b000f (<unknown>)" location: "JS frame :: http://localhost:8080/supportnow/jsLibrary/Ajax.js :: getChatText :: line 149" data: no]
[Break on this error] receiveReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded')..
.

my application is working fine in IE 6.0 but fails in FF2.0.

sometimes Firefox browser abnormally teminated, so i have to restart my pc.

my application is used for chatting
Jun 21 '07 #1
Share this Question
Share on Google+
7 Replies


acoder
Expert Mod 15k+
P: 16,027
Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

MODERATOR.
Jun 21 '07 #2

acoder
Expert Mod 15k+
P: 16,027
i am getting exception like this---
1.
[Exception... "Component returned failure code: 0x804b000f [nsIXMLHttpRequest.setRequestHeader]" nsresult: "0x804b000f (<unknown>)" location: "JS frame :: http://localhost:8080/supportnow/jsLibrary/Ajax.js :: getChatText :: line 149" data: no]
[Break on this error] receiveReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded')..
.

my application is working fine in IE 6.0 but fails in FF2.0.

sometimes Firefox browser abnormally teminated, so i have to restart my pc.

my application is used for chatting
Welcome to TSDN!

Can you post some of your code (using code tags please).
Jun 21 '07 #3

P: 6
These are some lines of code-

function getChatText() {
receiveReq.open("POST", getUrl ,true);
receiveReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
receiveReq.onreadystatechange = handleGetChat;
var queryString=OperatorDept.getParameterString();
var queryParmaSt=queryString+"&optyping="+opTyping+"&m essageReciver="+escape(messageReciver);
receiveReq.send(queryParmaSt);
}
//Function for handling the return of chat text
function handleGetChat() {
try{
if (receiveReq.readyState == 4) {
if ((receiveReq.status == 200)||(receiveReq.status == 0)) {
var chat_div = document.getElementById("div_chat");
var lastMessage;
var chat_typing=document.getElementById("div_typing");
var oroot = receiveReq.responseXML.getElementsByTagName("root" );
var messageObj = receiveReq.responseXML.getElementsByTagName("messa ge");
var sessionOut = receiveReq.responseXML.getElementsByTagName("sessi onexpired");
//this will return an object specify that whether a party is typing or not
var typingStatus= receiveReq.responseXML.getElementsByTagName("typin g");
//alert(sessionOut.length);
//redirecting the page if the session is out
if(sessionOut.length>0){
//alert(sessionOut.length);
alert("inside ajax.js ");
location.href="SessionExp.htm";
}

//execute the typing status
chat_typing.innerHTML="";
if(typingStatus.length!=0){
for(var j=0;j< typingStatus.length;j++){
var oppTyping=typingStatus[j].childNodes[0].firstChild.nodeValue;
if(oppTyping==messageReciver){
var oppName=chatUserList.getUserNickName(oppTyping);
chat_typing.innerHTML="<img src='Images/typing.gif' >"+oppName+" is typing a message";
}//end if
}//end for
}//end if typing status.length
var n_messages = messageObj.length;
msgString="";
if(n_messages!=0){
for (var i = 0; i < n_messages; i++) {
var messageID=messageObj[i].childNodes[0].firstChild.nodeValue;
var msgChatRoom=messageObj[i].childNodes[8].firstChild.nodeValue;
OperatorDept.setDeptMessageID(msgChatRoom,messageI D);
var postedTime=messageObj[i].childNodes[1].firstChild.nodeValue;
var sender=messageObj[i].childNodes[2].firstChild.nodeValue;
var senderName=messageObj[i].childNodes[3].firstChild.nodeValue;
var reciver=messageObj[i].childNodes[4].firstChild.nodeValue;
var recName=messageObj[i].childNodes[5].firstChild.nodeValue;
//alert(reciverName);
var msgText=decodeURIComponent(messageObj[i].childNodes[6].firstChild.nodeValue);
//alert(msgText);
var msgtype=messageObj[i].childNodes[7].firstChild.nodeValue;

//Let this function to handle, store and display each message
chatMessageHandler(messageID,sender,senderName,rec iver,recName,msgText,msgtype,msgChatRoom);
//alert(messageID+sender+reciver+msgText+msgtype+msg ChatRoom);
}//End for loop
chat_div.innerHTML+=msgString;
chat_div.scrollTop = 1000000;
}//End if(n_messages

}
mTimer = setTimeout('getChatText();',2000);

}
}catch(e){
alert(e);

}
}
Jun 21 '07 #4

acoder
Expert Mod 15k+
P: 16,027
See an example of a POST request. Are you sure the response is valid XML?
Jun 21 '07 #5

P: 6
See an example of a POST request. Are you sure the response is valid XML?


Yeah my response is valid XML. it is working fine on Opera , IE 7 as well as Safari browser.

<?xml version=\"1.0\" ?> this is the first line of dynamic generated XML.

is it ok ? .

actually i am new to developement field. and currently i am working on Maintenance project.


thanks
Jun 22 '07 #6

acoder
Expert Mod 15k+
P: 16,027
Try adding the following:
Expand|Select|Wrap|Line Numbers
  1. if (receiveReq.overrideMimeType) {
  2.   receiveReq.overrideMimeType('text/xml');
  3. }
Jun 22 '07 #7

P: 6
Try adding the following:
Expand|Select|Wrap|Line Numbers
  1. if (receiveReq.overrideMimeType) {
  2.   receiveReq.overrideMimeType('text/xml');
  3. }
Sorry for late reply, but i was on leave.
I have already tryed above line but getting same error.
Jun 27 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.