jQuery with other libraries

Learn how to use jQuery with other libraries.

jQuery jquery with other Libraries


There are many JavaScript libraries to help the developer to develop web applications. These libraries are designed to solve a particular problem efficiently. There may be some requirement of using these different libraries with jQuery. So, you may find incompatibility using these libraries with jQuery. In this section we are discussing the ways to use jQuery with other libraries. This issue comes as other libraries also uses $ to access the function of variable name. In this example you will see how to use $ to access both jQuery and other libraries functions and variables.

Using jQuery with other Libraries:

Let's see how we can use jQuery with other libraries.

In your application if there is requirement of including other libraries such as  prototype.js, YUI or mootools with jQuery, you can use the .noConflict() method of jQuery.

In jQuery $ is an alias for jQuery, so you can use jQuery() for accessing the jQuery methods. The following code example shows how you can use other libraries with jQuery:

<head><title>jQuery Example</title>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
   jQuery.noConflict(); //For using other libraries
  // Use jQuery using function jQuery(...)
   //write your code here
  // Use Prototype with $(...), etc.

<body><div id="messagebox"></div></body>

In this we have studied how to use jQuery with other libraries.

Learn from experts! Attend jQuery Training classes.

Share on Google+Share on Google+

jQuery with other libraries

Posted on: September 2, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles



Discuss: jQuery with other libraries  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
April 5, 2012
jquery function

I need a jquery function to validate my textbox value. Requirement: required filed:true, minlength:8, maxlength:16, should allow only alphabets, numbers. i have written one function: jQuery.validator.addMethod("nameRegex", function (value) { // alert(value); if (value.length >= 8) { // alert(value.length); return value.match(/^[a-zA-Z0-9 ]+$/.test(value)); } }, "Contain only letters, numbers."); but this is not working can any one pls help me in this. -Sindhu.A
July 6, 2012

very good........