Hello Friends,
While developing my project in Zend Framework, i came across a scenario where it was needed to use both Prototype and Jquery in same application. Though it was seeming okay to use both in same application but my Firebug alarmed me with some Error messages. These error messages were about JQeury functions that were working fine before i addedd Prototype in my code.
After some Error tracking and Googling i found the solution so i am sharing with you
Reason of problem: Both frameworks use $()-function declaration so it causes problems when both JQuery and Prototype are used in same application.
Solution of Problem: I solved this problem by using jQuery alias function jQuery()
Example Code:
Following was my code before problem fixation:
<script type=”text/JavaScript”>
$(document).ready(function(){
$(“form#test-form”).submit(function(){
$(“#msg”).val(“Hello world”);
});
return true;
});
</script>
I modifed to fix the problem:
<script type=”text/JavaScript”>
jQuery(function($){$(document).ready(function(){
$(“form#test-form”).submit(function(){
$(“#msg”).val(“Hello world”);
});
return true;
});});
</script>
Thats It!
Though it was more then eassy but was new for me, hopefully be helpfull for you too

.
Great post.
You can also use the jQuery.noConflict function (http://docs.jquery.com/Core/jQuery.noConflict) at the end of your jQuery script to achieve the same result.
THANK YOU!!
Such a simple soultion to such an annoying problem.
Thanks !
I had a similar problem, and the others solutions didn’t work (jQuery.noConflict etc).
Now it works as it should be. THANKS
Many thanks!