CaribSt
CaribSt

Reputation: 11

How to resolve conflict issues with jQuery + other libraries

Can someone help me figure out how to write a no conflict function for js for my weebly website.

http://cadogan.weebly.com/big-name.html

Thank you.

Upvotes: 1

Views: 667

Answers (2)

jefflunt
jefflunt

Reputation: 33954

You could try using jQuery instead of $, or using the .noConflict() method:

http://api.jquery.com/jQuery.noConflict/

Upvotes: 0

Jason Dean
Jason Dean

Reputation: 9615

I assume you mean that you get errors when you try to reference jQuery using $.

Since you are loading Scriptaculous after jQuery, it is overwriting the $ alias to jQuery. You can instead us the jQuery object directly.

jQuery(function() {
    jQuery('#mydiv').html("<h1>hi</h1>");
});

Upvotes: 3

Related Questions