Write better jQuery!

Write better jQuery!

jQuery is a great framework that make our life easer when it comes to start writing javascript or manipulate the DOM.

The only problem is that because jQuery make everything easer some developer forget to write good jQuery, that is following almost the same good practices that developers should use when writing JavaScript.

A very simple example of this is the following:

$(“document”).ready(function() {

});

This is the most popular way to start using jQuery. If you don’t care about populating with globals variables or the loading performance is not a worry for you, this kind of code works for you.

But when you are working with bigger applications you don’t want that your variables gets globals and obviously you want the best performance for you app.

The solution is follow the best practices. The example above can be written like this:

(function($, window, document) {

// now $ is locally scoped

$(function() {

// the DOM is ready

});

}(window.jQuery, window, document));

Do you wanna know even more best practices? Take a look to this article, is a must to read:

jQuery BEST PRACTICES

Get Started with Sharepoint Framework

In this PnP Web Cast we concentrated on showing in practice how to get started with upcoming SharePoint Framework. We demonstrated the preview tooling (*) for development and how the development cycle will work with SharePoint Framework.

https://channel9.msdn.com/blogs/OfficeDevPnP/PnP-Web-Cast-Getting-started-with-SharePoint-Framework

 

First video of our Sass tutorial is online!

First video of our Sass tutorial is online!

 

Hello everybody. I am happy to say that the first video of a serie of videos about Sass is online and you can see it in the Tutorial’s page. I will try to upload new videos in a regular basis, meanwhile send me your feedbacks to have an idea of what I should improve.

This is the first time I create a video serie and I was a little nervous I must to admit. Now I am working in the second one which will be a little longer because we will get our hands dirty creating our workflow with Gulp.

Enjoy this first video and do not miss the next ones!!!