Using jQuery noConflict() with script.aculo.us

前端 未结 4 1688
萌比男神i
萌比男神i 2021-01-16 08:12

I have a site using a \"widget\" (from http://healcode.com) that includes the script.aculo.us JavaScript library. The problem is that the site I\'m building is on WordPress,

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-16 08:17

    This worked for me so that I can have jQuery and script.aculo.us/Prototype working well together. Credit goes to codeimpossible for this lifesaver!

    Instead of:

    jQuery(document).ready(function () {
    
        // Code to run on DOM ready
    
    }); // End document.ready
    

    Try this:

    ( function($) {
    
        // Code to run on DOM ready
    
    } )( jQuery ); // End document.ready
    

提交回复
热议问题