tomfmason
09-28-2006, 12:38 AM
I have written a relatively simple chat script. The issue that I am having is that the results are not shown in FireFox or Opera but are fine in IE 6. I am not exactly sure what the issue is. Well I have narrowed it down to the function that gets the chat text.
here are the functions that retrieve the chat text.
function getChat() {
getText.open('get', 'process.php?action=getChat');
getText.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
getText.onreadystatechange = handleGetChat;
getText.send(null);
}
function handleGetChat() {
if (getText.readystate == 4) {
var chat = document.getElementById('chatBox');
var chatText = getText.responseText;
chat.innerHTML = chatText;
chat.scrollTop = chat.scrollHeight;
//chatTimer is a global variable
chatTimer = setTimeout('getChat();', 2000);
}
}
I have heard that Opera was good for displaying errors. It shows none. However, FireFox shows one..
Error: junk after document element
Source File: http://www.mysite.com/process.php?action=getChat[/url]
Line: 1, Column: 11
Source Code:
<b>Tom</b>: Opera is not showing any errors and at the same time is not showing any results<br />
-----------^
I thought that maybe I needed to escape the : so I just removed it. The column just moved to 13. So Then I thought maybe it was the <b> </b> 's . So I removed them..
Now I am getting the following error.
Error: syntax error
Source File: http://www.mysite.com/process.php?action=getChat
Line: 1, Column: 1
Source Code:
Tom Opera is not showing any errors and at the same time is not showing any results<br />
I have I have tried every thing that I can think of except throwing in some alerts to see where in the process it is having the problem..
Has anyone had similar issues?
I knew that I was going to have issues with making it compatible with Netscape Navigator but did not think I would have any with Mozilla..
Any suggestions would be great..
Thanks,
Tom
here are the functions that retrieve the chat text.
function getChat() {
getText.open('get', 'process.php?action=getChat');
getText.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
getText.onreadystatechange = handleGetChat;
getText.send(null);
}
function handleGetChat() {
if (getText.readystate == 4) {
var chat = document.getElementById('chatBox');
var chatText = getText.responseText;
chat.innerHTML = chatText;
chat.scrollTop = chat.scrollHeight;
//chatTimer is a global variable
chatTimer = setTimeout('getChat();', 2000);
}
}
I have heard that Opera was good for displaying errors. It shows none. However, FireFox shows one..
Error: junk after document element
Source File: http://www.mysite.com/process.php?action=getChat[/url]
Line: 1, Column: 11
Source Code:
<b>Tom</b>: Opera is not showing any errors and at the same time is not showing any results<br />
-----------^
I thought that maybe I needed to escape the : so I just removed it. The column just moved to 13. So Then I thought maybe it was the <b> </b> 's . So I removed them..
Now I am getting the following error.
Error: syntax error
Source File: http://www.mysite.com/process.php?action=getChat
Line: 1, Column: 1
Source Code:
Tom Opera is not showing any errors and at the same time is not showing any results<br />
I have I have tried every thing that I can think of except throwing in some alerts to see where in the process it is having the problem..
Has anyone had similar issues?
I knew that I was going to have issues with making it compatible with Netscape Navigator but did not think I would have any with Mozilla..
Any suggestions would be great..
Thanks,
Tom