2013-06-24 154 views
1

我刚开始学习SPA应用程序,我遇到了在IE8上运行它的问题。我正在使用mvc4和EF。该应用程序是使用杜兰达制作的。微风和Internet Explorer 8问题

我使用jQuery 1.10因为jQuery 2不能在IE 8

工作基本误差即时得到是

'Unhandled exception at line 786, column 9 in http://localserver/scripts/breeze.debug.js 

0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method'. 

该应用程序运行正常的Firefox和Chrome。

+1

您是否尝试过使用最新的微风。 v 1.3.6? –

+0

是的,我做过了。我正在破解的脚本是breeze.debug.js。方法是 function exec(self) - 该行是return contexts.some(function(context){return context.fn(context,self.v);}); – CodeNoob

+0

@JayTraband - 是的。我正在破解的脚本是breeze.debug.js。方法是function exec(self) - 行是return contexts.some(function(context){return context.fn(context,self.v);}); – CodeNoob

回答

5

确保您在'breeze.js'之前包含了es5-shim.js and es5-sham.js

例如:

<!--[if lt IE 9]> 
     <script src="Scripts/es5-shim.js"></script> 
     <script src="Scripts/es5-sham.js"></script> 
<![endif]--> 
<script src="Scripts/jquery-1.9.1.js"></script> 
<script src="Scripts/knockout-2.2.1.js"></script> 
<script src="/Scripts/q.min.js"></script> 
<script src="/Scripts/breeze.debug.js"></script> 

它在prerequisites部分记载,但没有样品的使用它。如果更新的样本包括这些,那将会很好。我知道我努力寻找解决这个问题的办法。

0

旧版浏览错过一些的阵列功能,所以加一些javascript :)

if (!('bind' in Function.prototype)) { 
     Function.prototype.bind= function(owner) { 
      var that= this; 
      if (arguments.length<=1) { 
       return function() { 
        return that.apply(owner, arguments); 
       }; 
      } else { 
       var args= Array.prototype.slice.call(arguments, 1); 
       return function() { 
        return that.apply(owner, arguments.length===0? args : args.concat(Array.prototype.slice.call(arguments))); 
       }; 
      } 
     }; 
    } 

    if (!('trim' in String.prototype)) { 
     String.prototype.trim= function() { 
      return this.replace(/^\s+/, '').replace(/\s+$/, ''); 
     }; 
    } 

    if (!('indexOf' in Array.prototype)) { 
     Array.prototype.indexOf= function(find, i /*opt*/) { 
      if (i===undefined) i= 0; 
      if (i<0) i+= this.length; 
      if (i<0) i= 0; 
      for (var n= this.length; i<n; i++) 
       if (i in this && this[i]===find) 
        return i; 
      return -1; 
     }; 
    } 
    if (!('lastIndexOf' in Array.prototype)) { 
     Array.prototype.lastIndexOf= function(find, i /*opt*/) { 
      if (i===undefined) i= this.length-1; 
      if (i<0) i+= this.length; 
      if (i>this.length-1) i= this.length-1; 
      for (i++; i-->0;) /* i++ because from-argument is sadly inclusive */ 
       if (i in this && this[i]===find) 
        return i; 
      return -1; 
     }; 
    } 
    if (!('forEach' in Array.prototype)) { 
     Array.prototype.forEach= function(action, that /*opt*/) { 
      for (var i= 0, n= this.length; i<n; i++) 
       if (i in this) 
        action.call(that, this[i], i, this); 
     }; 
    } 
    if (!('map' in Array.prototype)) { 
     Array.prototype.map= function(mapper, that /*opt*/) { 
      var other= new Array(this.length); 
      for (var i= 0, n= this.length; i<n; i++) 
       if (i in this) 
        other[i]= mapper.call(that, this[i], i, this); 
      return other; 
     }; 
    } 
    if (!('filter' in Array.prototype)) { 
     Array.prototype.filter= function(filter, that /*opt*/) { 
      var other= [], v; 
      for (var i=0, n= this.length; i<n; i++) 
       if (i in this && filter.call(that, v= this[i], i, this)) 
        other.push(v); 
      return other; 
     }; 
    } 
    if (!('every' in Array.prototype)) { 
     Array.prototype.every= function(tester, that /*opt*/) { 
      for (var i= 0, n= this.length; i<n; i++) 
       if (i in this && !tester.call(that, this[i], i, this)) 
        return false; 
      return true; 
     }; 
    } 
    if (!('some' in Array.prototype)) { 
     Array.prototype.some= function(tester, that /*opt*/) { 
      for (var i= 0, n= this.length; i<n; i++) 
       if (i in this && tester.call(that, this[i], i, this)) 
        return true; 
      return false; 
     }; 
    }