Skip to content

Instantly share code, notes, and snippets.

@vman
Created January 25, 2012 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vman/1676424 to your computer and use it in GitHub Desktop.
Save vman/1676424 to your computer and use it in GitHub Desktop.
coffeescriptjquery
#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