Conflict Bootstrap, Prototype Js and Jquery

蓝咒 提交于 2020-01-21 12:14:46

问题


After 7 days of search and after i have tried different solutions and it did not work i would like to ask: I have a page with prototype js, protaplasm, and scriptaculous and jquery and Jquery-ui and it was working perfectly with the jquery no conflict until i recently downloaded a design with Bootstrap and here comes the trouble. Prototype js fonctionalities are no more working. The ajax update of prototype js and the inplaceeditor the scriptaculous are no more working. I have tried most work around but i did not really get the result. Does someone have a working solution ?


回答1:


I have found the answer. To avoid conflict between Jquery, Prototype js, protoplasm, twitter bootstrap First i added the jquery noconlict after jquery

<script type="text/javascript">

    $.noConflict();

    </script>

and i put every jquery code between

 jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.


///////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////

});

And most importantly i opened every other js file that uses jquery like bootstrap.min.js and i copied and pasted the code inside between

 jQuery( document ).ready(function( $ ) {
    // Code that uses jQuery's $ can follow here.


    ///////////////////////////////////////////////////////////////////////////////


    ///////////////////////////////////////////////////////////////////////////////

    });

I still have an error like TypeError: this.element is null controls.js with Firebug but everything works perfectly



来源:https://stackoverflow.com/questions/27322183/conflict-bootstrap-prototype-js-and-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!