Using JQuery and Prototype in the same page

Currently you can do something like this:

<head>          
    <script type="text/javascript" src="https://stackoverflow.com/obp/js/prototype.js"></script>
    <script type="text/javascript" src="https://stackoverflow.com/obp/js/jquery.js"></script>
    <script type="text/javascript">
        var $j = jQuery.noConflict();
    </script>
</head>

Then, use jQuery as $j() and Prototype’s $().

Leave a Comment