Weird Chrome prototype/jQuery conflict

前端 未结 2 1081
无人及你
无人及你 2020-11-29 08:25

We have an application with legacy code that relies on prototype, but we\'ve found it to be too \'heavy\' for most of the places we want to use it and and have found jQuery

2条回答
  •  鱼传尺愫
    2020-11-29 08:48

    From Core/jQuery.noConflict:

    NOTE: This function must be called after including the jQuery javascript file, but BEFORE including any other conflicting library, and also before actually that other conflicting library gets used, in case jQuery is included last. noConflict can be called at the end of the jQuery.js file to globally disable the $() jQuery alias. jQuery.noConflict returns a reference to jQuery, so it can be used to override the $() alias of the jQuery object.

    Maybe try changing it to:

     
    
    
    

提交回复
热议问题