I have a plugin I want to use, but it depends on the $ identifier, as apposed to using jQuery.
Is it possible to enable the $, to save me recoding the plugin?
EDIT
The plugin automatically adds the javascript, therefore I can't wrap it.
I have a plugin I want to use, but it depends on the $ identifier, as apposed to using jQuery.
Is it possible to enable the $, to save me recoding the plugin?
EDIT
The plugin automatically adds the javascript, therefore I can't wrap it.
Try this:
jQuery(function ($) {
/* You can safely use $ in this code block to reference jQuery
Call your plugin here
*/
})
I think you already know this. But still for reference http://api.jquery.com/jQuery.noConflict/
var $ = jQuery;
in the first line of the plugin. Sometime when i need to change all instance of $ to jQuery in a function. i just use it in the first line of the function and it works for me :) Thanks!
This should work, I believe:
var $ = jQuery.noConflict();
The code Sisir provided would work, or you can use this code:
jQuery(document).ready(function($){
// you can use $ here
});