Safely code jQuery with other libraries

In this tutorial we will teach the ways how to prevent your jQuery code on conflicting with other javascript libraries

Use noConflict()


You can use noConflict() so you can instantiate your own jQuery instance with a variable and prevent conflicting with the usage of $

Wrap your jQuery code with anonymous function


I think this is the best way of preventing conflicts with jQuery but still you can play with the $ or any variable you want. If you wrap your jQuery code with anonymous function it can use any variable within it.

Use “jQuery” variable on all jQuery code


jQuery variable is already the default namespace for jQuery library entirely on your whole page. You can use it without conflicting with other javascript libraries