So ich schreib ja nen chat
und da hab ich en ganz großes JS problem ?!
also hier der fehler der angezeigt wird in der FF fehler konsole
Fehler: uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: http://jonasdesign.beeven.de/nChat/js/user.js :: loadData :: line 37" data: no]
und noch mal für die chat msges
Fehler: uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: http://jonasdesign.beeven.de/nChat/js/chat.js :: loadData :: line 37" data: no]
und hier ist mal der Code von der chat.js datei
[code]//globale Instanz von XMLHttpRequest
var xmlHttp = false;
function unten(){
if(document.getElementById(‚scroll‘).checked == true){
document.getElementById(‚chat_box‘).scrollTop = document.getElementById(‚chat_box‘).scrollHeight - document.getElementById(‚chat_box‘).offsetHeight;
}
}
//XMLHttpRequest-Instanz erstellen
//… für Internet Explorer
try {
xmlHttp = new ActiveXObject(„Msxml2.XMLHTTP“);
} catch(e) {
try {
xmlHttp = new ActiveXObject(„Microsoft.XMLHTTP“);
} catch(e) {
xmlHttp = false;
}
}
//… für Mozilla, Opera, Safari usw.
if (!xmlHttp && typeof XMLHttpRequest != ‚undefined‘) {
xmlHttp = new XMLHttpRequest();
}
//aktuelle Daten laden
loadData();
//alle X Sekunden neue Daten holen (x=1)
setInterval(„loadData()“,1000);
function loadData()
{
if (xmlHttp) {
xmlHttp.open(‚GET‘, ‚getdata.php‘, true);
xmlHttp.send(null);
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
document.getElementById(‚chat_box‘).innerHTML = xmlHttp.responseText;
unten();
}
}
}
}
//---------------------------------------------
//---------------------------------------------
function saveData()
{
if (document.chat_form.chat_message.value != „“)
{
if (xmlHttp) {
xmlHttp.open(‚POST‘, ‚setdata.php‘);
xmlHttp.setRequestHeader(‚Content-Type‘, ‚application/x-www-form-urlencoded‘);
xmlHttp.send(‚message=‘+document.chat_form.chat_message.value);
}
}
else
{
window.alert(‚Keine Nachricht eingegeben‘);
}
document.chat_form.chat_message.value = ‚‘;
document.chat_form.chat_message.focus();
return false;
}[/code]