Created
July 23, 2011 01:46
-
-
Save nobuf/1100838 to your computer and use it in GitHub Desktop.
.live and .bind, the order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$('div').one('click', function(){ | |
console.log('div is clicked.'); | |
}); | |
//$('span').bind('click', function(){ | |
$('span').live('click', function(){ | |
console.log('span is clicked.'); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div> | |
<span>foo</span> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment