Friday, November 16, 2007

JQuery Interface.js issues.

We use the wonderful JQuery library when developing our site. Everything works fine, and with the new 1.2.x everything is super, super fast too.

But when we upgraded to the latest version of JQuery we started to get a very strange error :
jQuery.dequeue is not a function.

After som research it turns out this is due to compability problems with the interface.js library (used for nice visual effects) and the new JQuery version. You can read about it at this thread. However the thing is that JQuery has changed it's syntax for the dequeue function from : jQuery.dequeue(elem, effect);to:jQuery(elem).dequeue(effect);So before they fix this I just added a simple patch and now everything works fine :
/* Backwards compability to make JQuery to work with interface */
(function($){
$.extend({ dequeue : function(elem, effect) {
$(elem).dequeue(effect);
}
});
})(jQuery);


Note: doing the (xxx)(JQuery) prevents us from getting a JQuery not defined error.

10 comments:

Chris said...

So where did you added this piece of code at interface.js or at jquery-1.2.1.js ?

Mauvis said...

Thanks for this.

ToM said...

Thank you very much. Extremely helpful.

Jens said...

@chris: In none. I just added it in a file loaded after these two to achieve the 'monkey patching'.

Thanks javascript for letting me do this kind of stuff.

Patrick said...

Hey Jens, thanks for that, I stuck your code snippit in a separate jscript file, referenced it from my page, and now Interface works correctly once more.

thecancerus said...

so finally i can solve this problem thank you very much.

because of this error i was stuck with older version of jquery, for one of my plugin.

tralalalala said...

Brilliant! Thanks a million! This problem was really bothering me...

uiyui said...
This comment has been removed by a blog administrator.
avadhraj said...

Oh it was very good news for me, i am very happy get the your blog, and it will help me in software development
.

Samuel said...

In Software Development there have been many advancement.