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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...