2009
07.03

In a recent website build I wanted to incorporate two different coda style slider and the jQuery tabs effect together. Although they worked, when running them together on the same page they ran sluggish and the effects rendered slowly. The chaps woking on jQuery have built a quick fix for this exact problem.

The jQuery.noConflict(); solves this very neatly. Here’s how to implement it:

1. Insert the following in your header with the other scripts. This is basically saying that the variable J is replacing the $ due to the conflict.

<script language=”javascript” type=”text/javascript”>
var J = jQuery.noConflict();
</script>

2. Open one of the conflicting scripts and replace all instances of $ with the variable J. Use a find and replace tool for speed.

3. Save the script and refresh the page. The scripts should run cleanly.

2 comments so far

Add Your Comment
  1. [...] our previous post on jQuery Running Slow with Conflicting Scripts – A Solution See the jQuery No Conflict documentation Filed under: Uncategorized No Comments Comments (0) [...]

  2. Any insights into the workings of the noConflict() method? Would be good to take it apart to see what makes it tick.