View Single Post
Old 08-08-2007, 09:34 AM   #1 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
Question Object Does Not Support This Property or Method

Can anyone see whats the problem with this code?

HTML Code:
<script type="text/javascript">
var xmlHttp;
function stateChanged() { 
	if (xmlHttp.readyState==4) { 
		document.getElementById("mysql_check").innerHTML=xmlHttp.responseText;
	}
}
function getXmlHttpObject() {
	var xmlHttp = null;
	if (window.ActiveXObject) {
  		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		xmlHttp = new XMLHttpRequest();
 	}
	return xmlHttp;
}
function mysqlReset() {
	document.getElementById("mysql_check").innerHTML = "<input type=\"button\" value=\"Check Connection\" onClick=\"mysqlCheck()\">"
}
function mysqlCheck() {
	document.getElementById("mysql_check").innerHTML = "Checking...";
	var host = document.getElementById("mysql_host").value;
	var user = document.getElementById("mysql_user").value;
	var pass = document.getElementById("mysql_pass").value;
	var db = document.getElementById("mysql_db").value;
	if (host.length==0 || user.length==0 || pass.length==0 || db.length==0) {
		alert("Please fill in all fields");
		mysqlReset();
		return;
	}
	xmlHttp = getXmlHttpObject;
	if (xmlHttp==null) {
		alert("Your browser doesn't suppert AJAX which is needed to check your connection");
		mysqlReset();
		return;
	}
	var url = "http://www.stuff4web.co.uk/SCMS/admin_check_mysql.php?h="+host+"&u="+user+"&p="+pass+"&d="+db+"&s="+Math.random()*10;
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET",url,true);          // LINE 74
	xmlHttp.send(null);
}
</script>
I am getting the error "Object doesn't support this property or method" on line 74 (maked above)
__________________
Stuff4Web.co.uk - The ultimate resource for webmasters

50% off all orders £1-£50! Just enter the code AGSIG01 at the checkout! Offer ends: 01/09/2008
markster is offline   Reply With Quote