Created
January 25, 2012 14:11
-
-
Save vman/1676424 to your computer and use it in GitHub Desktop.
coffeescriptjquery
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
#Create a new Button | |
myButton = $("<input id='cfLink' type='button' value='Click Me'/>") | |
#Assign a click function to the button which sends the button itself as the first parameter | |
myButton.click -> linkClicked (this) | |
#Push myLink into the DOM after the ribbon container. | |
$("#s4-ribbonrow").after myButton | |
#When this function is called, alert the value attribute of the button. | |
linkClicked = (button) -> | |
alert button.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment