All pastes #150332 Raw Edit

callback

public text v1 · immutable
#150332 ·published 2006-08-26 19:27 UTC
rendered paste body
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
	<script type="text/javascript">
	// javascript.options.strict = true

	function Some()
	{
		this.action = function(callback)
		{
			callback.callback("test");
		}
	}

	function Trigger()
	{
		var some = new Some();

		trigger();

		function trigger()
		{
			some.action(this);
		}

		this.callback = function(message)
		{
			alert("Object.callback: " + message);
		}
	}

	function start()
	{
		try
		{
			var trigger = new Trigger();
		}
		catch(e)
		{
			alert(e);
		}
	}

	</script>
</head>

<body onload="start()">
	Why does this JavaScript not work? "TypeError: callback.callback is not afunction."
</body>
</html>