Why is there still a conflict between prototype and jquery?

I already read about how to load prototypes and jquery together, but these methods do not solve the problem.

I load jquery, then this file ( http://music.glumbo.com/izzyFeedback.js ), and then the prototype.

I wrapped the parts that use $ in izzyFeedback.js in

(function($) { })(jQuery); 

but it does not work. If I comment on the loading of the prototype, it works correctly.

+4
source share
3 answers

You put jQuery.noConflict(); before the wrapper (function($) { })(jQuery) ?

There are other methods in the docs http://api.jquery.com/jQuery.noConflict/

I had previous success using var j = jQuery.noConflict(); and replacing all instances of $ and jQuery with j .

+2
source

You need to use jQuery.noConflict() to return $ back to everything that was before.

Then you need to use jQuery instead of $ for the jQuery function or use what you assigned jQuery.noConflict() .

+1
source

The JavaScript error console shows the following:

 Uncaught exception: TypeError: Cannot convert 'a' to object Error thrown at line 1, column 62584 in initWidgetOnSuccess(a) in http://w.sharethis.com/share4x/js/st.8420922a8df40577276f021cf40c4bea.js: widget.metaInfo=a.data; called from line 1, column 0 in http://wd.sharethis.com/api/getApi.php?return=json&url=http%3A%2F%2Fmusic.glumbo.com%2F&fpc=b3bd5f6-12f4973f8f5-23e02178-1&cb=initWidgetOnSuccess&service=initWidget: initWidgetOnSuccess(); 

You are trying to restore the a.data property, and a is not an object. The error is that getApi.php does not return a valid JSON string.

0
source

Source: https://habr.com/ru/post/1347700/


All Articles