Created
February 19, 2012 13:35
-
-
Save jwoodlee/1863867 to your computer and use it in GitHub Desktop.
Jquery Tips
This file contains hidden or 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
Binding a parametrized a non anonymous function to a button in jquery | |
Say you have the function | |
function buildDialog( parentId ){ | |
alert(parentId); | |
return false; | |
} | |
And the following link <a href="5" class="attach">Do Something</a> | |
You can bind it to a like like | |
$('.attach').button.bind('click', {parentId: <%=current_user.id%>}, buildDialog); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment