Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Ajax Jquery jQuery with other libraries

Related Tutorials


 
 

Share on Google+Share on Google+

jQuery with other libraries

Advertisement
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:

<html>
<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>
<script>
   jQuery.noConflict(); //For using other libraries
  // Use jQuery using function jQuery(...)
  jQuery(document).ready(function(){
   //write your code here
   });
  // Use Prototype with $(...), etc.
   $('messagebox').hide();
</script>

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

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

Learn from experts! Attend jQuery Training classes.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 2, 2010

Related Tutorials

Discuss: jQuery with other libraries  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:2
sindhu
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
ssssss
July 6, 2012
reslut

very good........
DMCA.com