Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery does not work with Prototype
    text
    copied!<pre><code>&lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; var $jq = jQuery.noConflict(); $jq(document).ready(function(){ alert("123"); $jq("#redactor_content").redactor(); alert("456"); }); &lt;/script&gt; &lt;script src="prototype.js"&gt;&lt;/script&gt; &lt;script src="redactor.js"&gt;&lt;/script&gt; </code></pre> <p>"redactor.js" is the WYSIWYG-editor based on JQuery: <a href="http://imperavi.com/download/redactor/get/" rel="nofollow">http://imperavi.com/download/redactor/get/</a> with that source:</p> <pre><code>... (function($){ // Initialization $.fn.redactor = function(options) { ... }; })(jQuery); ... </code></pre> <p>When I comment "prototype.js" - everything works(I see "123456").</p> <p>With "prototype.js" - see only "123" and "redactor" doesn't work. (It's means that the namespace is working correctly, right? Why then the second alert is not working?)</p> <p>When I comment only <code>$jq(document).ready(function(){</code> and move "redactor.js" before calling (call "<code>redactor()</code>" without waiting DOM) - everything fine too.</p> <p>I do not understand the principle. After including "jquery.js" I first "$" overwrite and then include "prototype.js" to avoid conflicts. But Namespace Jquery somehow still intersects with Prototype. I suspect that the error is somewhere here: <code>$jq("#redactor_content").redactor();</code> and I need to do something like: <code>.redactor($jq);</code>, but it broke my head and I can not guess.</p> <p><strong>P.S.:</strong> Yeah, I read the documentation ( <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries" rel="nofollow">http://docs.jquery.com/Using_jQuery_with_Other_Libraries</a> ) and tried different ways(swaps libraries and try <code>$.noConflict</code>, <code>jQuery(document).ready...)</code>. I wrote an example that anything is working and there is some clarity.</p> <p>My second question: will it work together: <code>jQuery(document).ready(function()</code> and Prototype's <code>document.observe("dom:loaded", function()</code> and if NO, how to get to work together?</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload