<p>What experience can you share about using multiple AJAX libraries?</p>

<p>There are useful features in Prototype, some in jQuery, the Yahoo library, etc. Is it possible to include all libraries and use what you want from each, do they generally all play nicely together with name spaces, etc. For the sake of speed is there a practical limit to the size/number of libraries to include or is this negligible? Are there pairs that work particularly well together (e.g. Prototype/Scriptaculous) or pairs that don't?</p>

[{'answer_id': 60378, 'author': 'Iain Holder', 'author_id': 1122, 'author_profile': 'https://Stackoverflow.com/users/1122', 'pm_score': 1, 'selected': False, 'text': "<p>I'm using jQuery and the javascript file only version of the Microsof ajax tool kit side by side in project right now.</p>\n\n<p>I think I'm going to go with jQuery and end up removing the Microsoft one.  I'm very new to jQuery, but the more I learn about it, the more enamoured I get. </p>\n"}, {'answer_id': 60432, 'author': 'Till', 'author_id': 2859, 'author_profile': 'https://Stackoverflow.com/users/2859', 'pm_score': 2, 'selected': False, 'text': "<p>I'm a jQuery believer as well, so pardon my lack of knowledge about the others, but ...</p>\n\n<p>What makes jQuery so great is the no-conflict mode, so for example, you would do:</p>\n\n<pre><code>$('#foobar').whatever();\n</code></pre>\n\n<p>With no-conflict mode, you'd do this:</p>\n\n<pre><code>var jq = jQuery.noConflict();\njq('#foobar').whatever();\n</code></pre>\n\n<p>One less thing to worry about. I'd imagine prototype offers a similar feature, and Yahoo as well.</p>\n\n<p>But anyway, I'd don't want to advocate jQuery too much and make people mad, but whatever library you select, I think they all can do pretty much of everything you would need. Especially think about the benefits of <strong><em>not</em></strong> having to learn three different libraries.</p>\n\n<p>All three should be capable. Select the one you like best and extend it. :)</p>\n"}, {'answer_id': 60444, 'author': 'Matthias Winkelmann', 'author_id': 4494, 'author_profile': 'https://Stackoverflow.com/users/4494', 'pm_score': 0, 'selected': False, 'text': "<p>Ruby on Rails uses both prototype and Scriptaculous by default, as there is little overlap between the two. I've also used yui snippets in addition to that and have never had a problem. Load times are an issue, but the libraries are usually cached, so it's only on the first page loaded.</p>\n"}, {'answer_id': 61881, 'author': 'Walter Rumsby', 'author_id': 1654, 'author_profile': 'https://Stackoverflow.com/users/1654', 'pm_score': 2, 'selected': False, 'text': '<p>YUI is pretty strongly namespaced so shouldn\'t clash with other libraries. </p>\n\n<p>As mentioned you can run jQuery in no conflict mode.</p>\n\n<p>Prototype <em>does</em> have some issues playing nice with other libraries in part because it (or it used to) modifies core Objects like <code>Array</code>. <a href="http://code.google.com/p/protosafe/" rel="nofollow noreferrer">Protosafe</a> attempts to address those issues.</p>\n\n<p>Script.aculo.us is simply a widget library that sits on top of Prototype so those two should obviously play nicely together.</p>\n\n<p>All of this means that you <em>could</em> use YUI, jQuery, Prototype &amp; Script.aculo.us in your application, but you may find that using a single library makes it a lot easier to maintain things.</p>\n'}, {'answer_id': 61887, 'author': 'Ryan Doherty', 'author_id': 956, 'author_profile': 'https://Stackoverflow.com/users/956', 'pm_score': 4, 'selected': True, 'text': '<p>You could use all those libraries, but I highly recommend against it. Downloading and executing that much JavaScript will most likely choke the browser and slow down your user\'s experience. It would be much better from a user\'s perspective and a developer\'s to pick one. Less context/architecture switching and less code to maintain.</p>\n\n<p>Like other answers have said, most don\'t conflict. </p>\n\n<p>See Yahoo!\'s <a href="http://developer.yahoo.com/performance/" rel="noreferrer">Exceptional Performance</a> site for more info. </p>\n'}, {'answer_id': 65305, 'author': 'Alejandro Bologna', 'author_id': 9263, 'author_profile': 'https://Stackoverflow.com/users/9263', 'pm_score': 2, 'selected': False, 'text': '<p>You could use <a href="http://code.google.com/apis/ajaxlibs/" rel="nofollow noreferrer">Google AJAX Libraries API</a>.\nIt provides a common distribution network and a loading architecture for jQuery, prototype, script.aculo.us, MooTools and dojo</p>\n'}, {'answer_id': 192331, 'author': 'Caged', 'author_id': 26876, 'author_profile': 'https://Stackoverflow.com/users/26876', 'pm_score': 1, 'selected': False, 'text': "<p>The best strategy is to <strong>not use multiple libraries</strong>.  It's tempting to want to throw more libraries at a problem, but it's inefficient, error prone, and makes your code harder to maintain by others.</p>\n\n<p>In most cases you should be able to avoid using multiple libraries by understanding your problem domain and which library will help you best solve it.  There is also a myriad of plugins and extensions for all of these libraries.</p>\n\n<p>For example, JQuery supports cross-domain JSONP calls right out of the box and has a nice widget library in JQueryUI, Prototype does not.</p>\n\n<pre><code>$.getJSON('http://anothersite.com/mashup.json?callback=?', function(data) { });\n</code></pre>\n\n<p>Prototype has really good OO support and it's easy to traverse the DOM, but lacks some of the cross-domain functionality required to create widgets and mashups.</p>\n\n<pre><code>var Foo =  Class.create({  \n  initialize: function(name) {\n    this.name = name;\n  }   \n});\n\nvar Bar = Class.create(Foo, {\n  initialize: function($super, name)  {\n     $super(name);\n   }\n});\n</code></pre>\n\n<p>Mootools has great effects, good OO support, really solid widgets and cross domain request, but (and this might just be my impression), the development community isn't as collaborative and social with the global community (outside of mootools) as the other communities (Prototype used to be this way). This could be a result of their main developer(s) living outside the US, and thus are not able to attend as many conferences and participate in the greater community.  I wouldn't let that deter you completely though, but it is something to keep in mind.</p>\n"}]
['https://Stackoverflow.com/questions/60360', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4639/']