title: How can solve IE8 prototype and fn issue?
body: <p>I have a big problem with jquery.fn and prototype in IE8. I write a simple jquery library like this in demo.js file: </p>
  
  <pre><code> (function(){
      Demo = function(){
          return new DemoLibrary();
      };
      function initAjaxError(){
        $(document).ajaxError(function(e, request, settings){
          switch (request.status) {
             case 400:
               var msg = $.parseJSON(request.getResponseHeader('message'));
               console.log(msg.message);
               break;
                  default:
                  case 403:
                      console.log('Access denied!');
                      break;
              }
          }); 
      }
      var DemoLibrary = function(){
          initAjaxError();
      };
      DemoLibrary.prototype = {
          prepareBody: function(){
             $('body').find('h1').css('font-size','72px');
          },
      };
      window.Test = window.$$ = demo = Demo();
      $$.fn = Object.getPrototypeOf(demo);
  }());
  </code></pre>
  
  <p>And then write some code for coloring plugin in plugin.js :</p>
  
  <pre><code>(function(){
      $$.fn.coloring ={
          setColor : function(hexValue,selector){
              $('body').find($(selector)).css('color','#'+hexValue);
         }
      };
  }());
  </code></pre>
  
  <p>At the end, I load this files with jquery-1.11.2.min.js in my index.html file:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
         &lt;meta charset="utf-8"&gt;
         &lt;script src="jquery-1.11.2.min.js"&gt;&lt;/script&gt;
         &lt;script src="demo.js"&gt;&lt;/script&gt;
         &lt;script src="plugin.js"&gt;&lt;/script&gt;
         &lt;script&gt;
           $(document).ready(function() {
              $$.prepareBody();
              $$.coloring.setColor('ff0000', 'p');
           })
        &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div&gt;
             &lt;h1&gt;This is h1 heading tag&lt;/h1&gt;
             &lt;p&gt;this is a paragraph&lt;/p&gt;
             &lt;div&gt;this  is a div paragraph&lt;/div&gt;
             &lt;h3&gt;&lt;p&gt;this is another paragraph&lt;/p&gt;&lt;/h3&gt;
         &lt;/div&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It's working perfectly in Firefox,Chrome and IE9 and higher,But in IE8 has some errors,first error says: </p>
  
  <pre><code>"Object doesn't support this property or method" in demo.js line 30
  </code></pre>
  
  <p>line 30 :</p>
  
  <pre><code>$$.fn = Object.getPrototypeOf(demo);
  </code></pre>
  
  <p>and other errors are : </p>
  
  <pre><code>'$$.fn' is null or not an object 
  </code></pre>
  
  <p>in plugin.js line 2 and another error : </p>
  
  <pre><code>'$$.coloring' is null or not an object
  </code></pre>
  
  <p>in index.html line 11.
  Finaly, I add prototype.js file after jquery library and before demo.js :</p>
  
  <pre><code>&lt;script src="jquery-1.11.2.min.js"&gt;&lt;/script&gt;
  &lt;script src="prototype.js"&gt;&lt;/script&gt;
  &lt;script src="demo.js"&gt;&lt;/script&gt;
  &lt;script src="plugin.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I placed this script in prototype.js :</p>
  
  <pre><code>if ( typeof Object.getPrototypeOf !== "function" ){
      (function(){
          function getPrototypeValue( o, p ) {
              if ( o.hasOwnProperty(p)){
                  var ownValue = o[ p ];
                  if ( delete o[ p ] ) {
                      var prototypeValue = o[ p ];
                      o[p] = ownValue;
                      return prototypeValue;
                  } else {
                      return o[p];
                  }
              } else{
                  return o[p];
              }
          }
          if (typeof "".proto === "object" ){
              Object.getPrototypeOf = function( object ) {
                  return getPrototypeValue( object, 'proto' );
              };
          }else{
              Object.getPrototypeOf = function( object ) {
                  getPrototypeValue( object, 'constructor' ).prototype;
              };
          }
      }());
  }
  </code></pre>
  
  <p>Now, These erors not solved yet : </p>
  
  <pre><code>'$$.fn' is null or not an object 
  </code></pre>
  
  <p>in plugin.js line 2 and another error : </p>
  
  <pre><code>'$$.coloring' is null or not an object
  </code></pre>
  
  <p>in index.html line 11.</p>
  
  <p>I'm very worry about my work. Enybody can rescue me?</p>