View Single Post
07-10-2008, 11:52 PM
#1
Seraskier is offline Seraskier
Status: I love this place
Join date: Jan 2007
Location: Charlotte
Expertise:
Software:
 
Posts: 542
iTrader: 0 / 0%
 

Seraskier is an unknown quantity at this point

Send a message via AIM to Seraskier Send a message via MSN to Seraskier

  Old  Cross Browser Ajax

http://www.revonal.com/revonal%203/register.html

It runs fine in IE7 but when i test it in Opera, Safari, and Firefox nothing happens.

I've tried many sections of code.
many more than posted
Code:
 if (typeof XMLHttpRequest != "undefined") {
        return new XMLHttpRequest();
    } else if (typeof ActiveXObject != "undefined") {
        return new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        throw new Error("XMLHttpRequest not supported");
    }
Code:
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
only when i use this does it only work in ie and no other browser.
Code:
function queryUsername(queryString) {
    var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	
	if(queryString.length <= 3)
	{ document.getElementById("response").innerHTML='Insufficient Characters'; }
	else
	{
		xmlHttp.open("GET","include/js/ajax/username.php?username="+queryString,true);
		xmlHttp.send(null);
	}
	
	xmlHttp.onReadyStateChange = function() {
		if(xmlHttp.ReadyState == 4 && xmlHttp.Status == 200) {
			document.getElementById("response").innerHTML=xmlHttp.ResponseText;
		}
	}
}
also with FF, my textboxes appear acouple pixels shorter than all other major browsers.