Using JQuery and Prototype in the same page

前端 未结 12 1232
忘了有多久
忘了有多久 2020-11-30 03:39

Several of my pages use both JQuery and Protoype. Since I upgraded to version 1.3 of JQuery this appears to be causing problems, because both libraries define a function nam

12条回答
  •  臣服心动
    2020-11-30 04:26

    
    
    

    or

    var scripty = document.createElement('script');
    scripty.href="/obp/js/jquery.js";
    document.getElementsByTagName('head')[0].appendChild(scripty);
    jQuery.noConflict();
    var $j = jQuery;
    

    EDIT:

    I tried out this suggestion but the last 2 lines produce the error

    jQuery is not defined
    

提交回复
热议问题