Skip to main content

Bug Tracker

Side navigation

Ticket #5835: onclick2.html

File onclick2.html, 1.3 KB (added by iraebrasil, January 18, 2010 04:14AM UTC)

trying to create a testcase for the fix

	<title>IE onclick + live</title>
	<script type="text/javascript" src="../../dist/jquery.js"></script>
	<script type="text/javascript">
		liveIEinlinecount = 0;
		$('<a id="liveIElink" href="javascript:void(liveIEinlinecount++);" onclick="return false;"><span>link</span></a>').prependTo('body');
		$(".whatever").live("click", function(event) {
		// the interval in to avoid using alerts and provide feedback for debug
			jQuery('#liveIElink').click(); // this doesn't trigger the bug
			jQuery('#liveIElink span').get(0).fireEvent('onclick'); // this also doesn't trigger the bug
		/* draft for Unit Tests
		// Verify that livehandler don't return true firing inline events in IE
		liveIEinlinecount = 0; // global on purpuse
		jQuery('<a id="liveIElink" href="javascript:void(liveIEinlinecount++);" onclick="return false;">link</a>').appendTo('body');
		equals( liveIEinlinecount, 0, "inline click" );
		liveIEinlinecount = undefined;
	<div id="testarea"></div>
	<div>The above number should always be 0, regardless of how many times you click on the link</div>

Download in other formats:

Original Format