title: jquery prototype conflict only in ie8
body: <p>I'm using jQuery to build a module for an existing page. The page uses also prototype, so there is the usual jQuery-prototype conflict. I'm using the jQuery.noConflict() and everything works fine in all browsers except  for ie (tested in ie8).
  I've read all similar questions in here and other sites, but i can't get it to work.
  This is about how it works: the page loads prototype and other .js files using prototype (effects.js, prototip.js etc) and then loads my module (aka jQuery is loaded after prototype).
  I read about changing the prototype's $() function to $$$(), but this is impossible (many other modules using prototype will then need to be changed), so it's only about changing my js.</p>
  
  <p>Then i read about using</p>
  
  <pre><code>(function($) {
      //my jQuery code in here
  
  })(jQuery);
  </code></pre>
  
  <p>but i don't completely understand it. My code is about like this:</p>
  
  <pre><code>$J = jQuery.noConflict();
  $J(document).ready(function(){
       fun1();
       //jquery stuff
       fun2();
  });
  
  function fun1(){
       //stuff/jQuery code/ call other functions
  }
  
  function fun2(){
       //stuff/jQuery code/ call other functions
  }
  </code></pre>
  
  <p>if i put all the above into <code>(function($) { /*all the above*/})(jQuery);</code></p>
  
  <p>i get that all functions are undefined.</p>
  
  <p>What am i doing wrong? Or is there another solution?</p>