복붙노트

[JQUERY] jQuery를하고 Mootools의 충돌

JQUERY

jQuery를하고 Mootools의 충돌

해결법


  1. 1.당신은 $를 사용의 jQuery 특정 코드가있는 경우, 가장 간단한 방법은 다음과 코드를 래핑하는 것입니다 :

    당신은 $를 사용의 jQuery 특정 코드가있는 경우, 가장 간단한 방법은 다음과 코드를 래핑하는 것입니다 :

    // Disable the $ global alias completely
    jQuery.noConflict();
    
    // For jQuery scripts
    (function($){
    
    // set a local $ variable only available in this block as an alias to jQuery
    ... here is your jQuery specific code ...
    
    })(jQuery);
    
    // For Mootols scripts
    (function($){
    
    // set a local $ variable only available in this block as an alias 
    // to Mootools document.id
    ... here is your Mootools specific code ...
    
    })(document.id);
    

    noConflict 문서의 두 번째 예를 참조하십시오.


  2. 2.나는 Mootools의에서 제공하는 호환성 모드에 대해 잘 모르지만, 쉬운 방법은 $ J (또는 jQuery를 (하여 스크립트에서 $의 모든 항목을 (대체해야합니다.

    나는 Mootools의에서 제공하는 호환성 모드에 대해 잘 모르지만, 쉬운 방법은 $ J (또는 jQuery를 (하여 스크립트에서 $의 모든 항목을 (대체해야합니다.


  3. 3.$와 jQuery $를 교체하고 그것을 작동합니다.

    $와 jQuery $를 교체하고 그것을 작동합니다.

  4. from https://stackoverflow.com/questions/2810399/jquery-and-mootools-conflict by cc-by-sa and MIT license