Jump to content

Puzzled About ()


Recommended Posts

<script language='javascript' type='text/javascript'>	function getHTTPObject(){	http = window.XMLHttpRequest ? new XMLHttpRequest : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP'): null);	return http;	}  	function output() {		if(httpObject.readyState == 4) {			json = httpObject.responseText;			var obj = eval('(' + json + ')');			eval(obj.timer);			document.getElementById('defenderoutput').innerHTML = obj.amount;		}	}	function attack(){			httpObject = getHTTPObject();		if (httpObject != null) {			httpObject.open('GET', 'test.php', true);			httpObject.send(null); 			httpObject.onreadystatechange = output;		}	}</script>

Where I call the output function in the attack function, if I opt out the (), it works. But if I make it output(); I get a "not implemented" error. I looked over the w3schools JavaScript functions page and can't think of whats wrong.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...