title: Conflict between $(document).ready and prototype.js
body: <p>I have this problem with <code>prototype.js</code> when I include <code>$(document).ready</code>
  in my webpage it doesn't work.</p>
  
  <p>Here is part of my code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="&lt;?php echo base_url();?&gt;asset/scripts/prototype.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;    
    function nl2br (str, is_xhtml) {   
      var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '&lt;br /&gt;' : '&lt;br&gt;';    
      return (str + '').replace(/([^&gt;\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
    }
  
    $(document).ready(function(){
      $('#sendmail2').on('submit', function(){
        alert('Ok');
      });
    });           
  &lt;/script&gt;
  </code></pre>
  
  <p>But when I remove prototype the script works fine.</p>