Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Jquery conflict – please help! Reply To: Jquery conflict – please help!

#147793
Chromawoods
Participant

On test-modal.html: jQuery is included AFTER a bunch of other jQuery-dependent plugins, which causes a whole bunch of errors. I would start there. Include jQ before the plugins.

On test-loading.html: The dollar variable ($) is used by some other function and is not used by jQuery, so no jQuery stuff that you do with $ will work there. If you want to use $ instead of using its alias, jQuery, you can achive it quite easily. If all you need is to do stuff at document ready, then replace this:

$(document).ready(function() {

…with this: jQuery(document).ready(function($) {

Now you have passed jQuery to that scope as $ and it will not interfere with that other $ function.

I don’t know how much control you have over all the other code on that site, but one solution would be to find that weird function that has hijacked the $ variable and call it something else, but then you need to fix all calls to that function to be sure that you don’t break stuff in other places.