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


This topic is now archived and is closed to further replies.

  • Create New...