View Single Post
03-02-2008, 05:44 PM
#2
schroder is offline schroder
schroder's Avatar
Status: Member
Join date: Nov 2004
Location:
Expertise:
Software:
 
Posts: 159
iTrader: 0 / 0%
 

schroder is on a distinguished road

  Old

Took a little testing, but here is a working copy of the javascript (which seemed to be the only problem). The snippet is below.

The main problems were the xmlHttp object needed to be created and the rest was case sensitivity issues.

Let me know if this works for you. =)

Code:
function checkUsername(str)
{
	var url = "username.asp";
	url = url + "?username=" + str;

	try {
	  xmlHttp = window.XMLHttpRequest?new XMLHttpRequest():
	  new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e) {
	  // browser doesn't support ajax. handle however you want
	}

	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}

function stateChanged()
{
	if (xmlHttp.readyState == 4  && xmlHttp.status == 200)
	{
		document.getElementById("response").innerHTML = xmlHttp.responseText;
	}
}