Skip to main content

Bug Tracker

Side navigation

Ticket #6869: testjs.html


File testjs.html, 0.7 KB (added by Christopher, August 04, 2010 08:13AM UTC)

code

<html>
	<head>
		<script src="http://code.jquery.com/jquery-1.4.2.js" type="text/javascript"></script>
		<script type="text/javascript">
			var test = {};
			
			
			function testOne()
			{
				$(test).trigger('onetest');
			}
			
			function testBind()
			{
				$(test).trigger('bindtest');
			}
			
			
			$(
				function() {
					$(test).one("onetest", one_Handler);
					$(test).bind("bindtest", bind_Handler);
				}
			);
			
			
			function one_Handler()
			{
				alert("one call");
			}
			
			function bind_Handler()
			{
				alert("bind call");
			}
		</script>
	</head>
	<body>
		<button onclick="javascript:testOne();">TEST with One</button>
		<button onclick="javascript:testBind();">TEST with Bind</button>
	</body>
</html>

Download in other formats:

Original Format