<script>
$(function() {
$.fn.aaaa = function() {
alert('aaaa');
};
$( "#foo" ).click(function() {
$.fn.aaaa();
});
</script>
<div id=foo>bbbb</div>