2

I used jQuery many times in noconflict mode as below

var $j = jQuery.noConflict();

and it works great every time.

Today, I used the jQuery 'before after' plugin. I used the same noconflict function but it did not work http://www.catchmyfame.com/2009/06/25/jquery-beforeafter-plugin/

I am not sure that $.fn.extend works with no conflict or not. Please help thanks

1 Answer 1

2

Well, $.fn.extend will not work if it is within your code. You'll need to use $j.fn.extend for your code (if $j is the name of the variable that you are using for jQuery).

Plugins should work as they normally adopt the following convention,

(function($){ 
    /*Plugin Code*/
})(jQuery); 

which allows the use of $ whilst guaranteeing no conflict.

(See my answer here: What does this JavaScript/jQuery syntax mean?)

I would check your plugin to see if this holds true.

Hope this helps

Sign up to request clarification or add additional context in comments.

3 Comments

The plug-in he linked does use aliasing and appears correct at first glance.
Thanks James Wiseman i am using jquery UI as well in this plug-in and found there is some problem with jqueryUI dev.jquery.com/ticket/1686 . still things are not working :(
That link suggests the problem si fixed. What version of jQuery are you using?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.