When I released PHP AJAX chat I knew that there was a problem with a few of the build of Firefox that didn’t like having SetTimeouts() outside of functions and requestobjects opening without full parameters. Well I have now fixed that and here is the patch. To install the patch do the following.
1. Open up index.php oh php ajax chat archive
2. find where this line is <script type=”text/javascript”> in mine it’s around line 33 and also find the end </script> which is around line 99.
3. Hilight this area and replace it with the following code
function sndReq(doit) {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject(”Msxml2.XMLHTTP”);
} catch (e) {
try {
xmlhttp = new ActiveXObject(”Microsoft.XMLHTTP”);
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != ‘undefined’) {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
httpr = xmlhttp;
if(doit){
chatsend = document.getElementById(”textbox”).value;
guyname = document.getElementById(”guyname”).value;
parameters = “nick=”+encodeURI(guyname)+”&textbox=”+encodeURI(chatsend);
httpr.onreadystatechange = handleResponse;
httpr.open(”POST”, “<?php echo $url;?>rpc.php”,true);
httpr.setRequestHeader(”Content-type”, “application/x-www-form-urlencoded”);
httpr.setRequestHeader(”Content-length”, parameters.length);
httpr.send(parameters);
document.getElementById(’textbox’).value = ”;
}else{
httpr.onreadystatechange = handleResponse;
httpr.open(”GET”,”<?php echo $url;?>rpc.php”,true);
httpr.send(null);
}
setTimeout(”sndReq(false)”,2000);
}
function handleResponse() {
if(httpr && httpr.readyState == 4){
var response = httpr.responseText;
document.getElementById(”chatbox”).innerHTML = response;
}
}
function formsubmit(e){
characterCode = null;
if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4’s which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE’s keyCode property
}
if(characterCode == 13){
sndReq(true);
}
}
sndReq(false);
source: hawkenterprises
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.

Original Source: