Saturday, 28 January 2012

Working with CoffeeScript on SharePoint : Interacting through jQuery

Now in this next part, lets see how CoffeeScript can be used with jQuery on SharePoint:
Lets start with the most nifty feature first:
$(document).ready(function () { 
    //Code here.
is now:
$ ->
    //Code here.  

CoffeeScript makes it extremely easy to iterate over jQuery collections using the for loop:

Simple demo using CoffeeScript with jQuery to create a button, append it after the SP ribbon and assign a click function to it.
I hope you have enjoyed the series as much as me. Please feel free to leave me any feedback through comments or email. Happy Exploring!

GitHub Link to the project:

No comments: