0

I am trying to add jQuery to the PHP of SQLBuddy and am getting some conflicts. If I just include jQuery, the rest of the program stops functioning and doesn't pull the tables / databases.

If I use the jQuery noConflict function, everything works, but I can't use any jQuery selectors. Is there a way to merge 2 libraries that will show you where there are 2 functions with the same name and prompt you to rename one of them?

Barmar
  • 741,623
  • 53
  • 500
  • 612
Alan
  • 2,046
  • 2
  • 20
  • 43
  • Sounds like you're not using `noConflict` correctly. Please show your code, we can't tell what you're doing wrong without it. – Barmar Aug 07 '14 at 23:47

1 Answers1

1

noConflict returns a reference to the jquery function, so you should just be able to assign the return value to a variable and use that instead of $ or jquery. Like so:

var $j = jQuery.noConflict();
// $j is now an alias to the jQuery function; creating the new alias is optional.

$j(document).ready(function() {
    $j( "div" ).hide();
});

see: http://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/

SimpleJ
  • 13,812
  • 13
  • 53
  • 93