Skip to content

Instantly share code, notes, and snippets.

@nobuf
Created July 23, 2011 01:46
Show Gist options
  • Save nobuf/1100838 to your computer and use it in GitHub Desktop.
Save nobuf/1100838 to your computer and use it in GitHub Desktop.
.live and .bind, the order
<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