Hallo,
derzeit versuche ich mich an einem kleinen Ajax Chat für eine Private Seite.
Soweit läuft auch alles im Opera aber im Firefox nicht.
Ich habe 2 Ajax Request
Alles anzeigen
function showData() ruft die Chat Texte Live ab, function showsData() die User Online Liste
Im Opera läuft alles soweit. Die Texte haben zwar ne Verzögerung beim 1 Aufruf von ca 10 Sec aber es läuft.
Im Firefox allerdings habe ich in beiden DIV Spalten die User Online Liste.
So ganz blicke ich auf dem JS Feld noch nicht ganz durch und hoffe auf eure Hilfe.
derzeit versuche ich mich an einem kleinen Ajax Chat für eine Private Seite.
Soweit läuft auch alles im Opera aber im Firefox nicht.
Ich habe 2 Ajax Request
Quellcode
- function ajaxFunction(){
- var ajaxRequest; // The variable that makes Ajax possible!
- try{
- // Opera 8.0+, Firefox, Safari
- ajaxRequest = new XMLHttpRequest();
- } catch (e){
- // Internet Explorer Browsers
- try{
- ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try{
- ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e){
- // Something went wrong
- alert("Your browser broke!");
- return false;
- }
- }
- }
- return ajaxRequest;
- }
- function showData() {
- //alert("i m here");
- htmlRequest = ajaxFunction();
- if (htmlRequest==null){ // If it cannot create a new Xmlhttp object.
- alert ("Browser does not support HTTP Request"); // Alert Them!
- return; // Returns.
- } // End If.
- htmlRequest.onreadystatechange = function(){
- if(htmlRequest.readyState == 4){
- document.getElementById("shoutarea").innerHTML = htmlRequest.responseText;
- var obj = document.getElementById('shoutarea');
- obj.scrollTop = obj.scrollHeight;
- }
- }
- htmlRequest.open("GET", "index.php?mode=outputinfo", true);
- htmlRequest.send(null);
- }
- showData();
- setInterval("showData()",1000);
- function showsData() {
- //alert("i m here");
- htmlRequest = ajaxFunction();
- if (htmlRequest==null){ // If it cannot create a new Xmlhttp object.
- alert ("Browser does not support HTTP Request"); // Alert Them!
- return; // Returns.
- } // End If.
- htmlRequest.onreadystatechange = function(){
- if(htmlRequest.readyState == 4){
- document.getElementById("onlinearea").innerHTML = htmlRequest.responseText;
- var obj = document.getElementById('onlinearea');
- obj.scrollTop = obj.scrollHeight;
- }
- }
- htmlRequest.open("GET", "index.php?mode=outputinfos", true);
- htmlRequest.send(null);
- }
- showsData();
- setInterval("showsData()",1000);
function showData() ruft die Chat Texte Live ab, function showsData() die User Online Liste
Im Opera läuft alles soweit. Die Texte haben zwar ne Verzögerung beim 1 Aufruf von ca 10 Sec aber es läuft.
Im Firefox allerdings habe ich in beiden DIV Spalten die User Online Liste.
So ganz blicke ich auf dem JS Feld noch nicht ganz durch und hoffe auf eure Hilfe.