IE8上使用SharePoint

时间:2017-01-05 03:30:59

标签: javascript jquery sharepoint internet-explorer-8 ie8-compatibility-mode

最近,在使用IE8在SharePoint上实现我的Web应用程序时遇到问题。 由于我的SharePoint的默认broswer是IE8,这对于我的情况是不可改变的。

请点击以下链接查看我的申请流程

The flow >> Select server and date > Show figure in chart with highchart.js > Click the plot on chart > Show table with datatable.js

当我点击该行的图表

时,弹出的问题是什么
  1. sp.core.js?rev = 7ByNlH%2BvcgRJg%2BRCctdC0w%3D%3D:2未捕获的TypeError:a.indexOf不是函数(...)
  2. 虽然chrome也会遇到此错误,但如果忽略错误,它也能正常运行。但IE8会立即阻止我。

    我在google上发现的,在IE8中处理indexOf()的方式是在我的HTML中添加以下脚本

    if (!Array.prototype.indexOf)
     {
      Array.prototype.indexOf = function(elt /*, from*/)
       {
         var len = this.length >>> 0;
    
    var from = Number(arguments[1]) || 0;
    from = (from < 0)
         ? Math.ceil(from)
         : Math.floor(from);
    if (from < 0)
      from += len;
    
    for (; from < len; from++)
    {
      if (from in this &&
          this[from] === elt)
        return from;
    }
    return -1;
    };
    }
    

    但我应该在哪里添加?在加载所有JS库之前或之后?

     <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"     "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=BIG5;IE=8">
    <link rel="stylesheet" href="SiteAssets/css/appLog/rome.css">
    <link rel="stylesheet" href="SiteAssets/css/appLog/responsive.dataTables.min.css">
    <link rel="stylesheet" href="SiteAssets/css/appLog/jquery.dataTables.min.css">
    <link rel="stylesheet" href="SiteAssets/css/appLog/bootstrap.min1.css">
    
    <!-- jQuery library -->
    <script src="SiteAssets/javascript/appLog/jquery-1.8.min.js" charset="UTF-8" type="text/javascript"></script>
    <script src="SiteAssets/javascript/appLog/bootstrap.min.js" type="text/javascript"></script>
    <script src="SiteAssets/javascript/appLog/rome.js" charset="UTF-8" type="text/javascript"></script>
    <script src="SiteAssets/javascript/appLog/jquery.dataTables.min.js" type="text/javascript"></script>
    <script src="SiteAssets/javascript/appLog/dataTables.responsive.min.js" type="text/javascript"></script>
    <script src="SiteAssets/javascript/appLog/highcharts.js" type="text/javascript"></script>
    <script src="SiteAssets/javascript/appLog/data.js" type="text/javascript"></script>
    <script src="SiteAssets/javascript/appLog/exporting.js" type="text/javascript"></script>
    

    如果没有编辑sharepoint核心javascript中的任何代码,我有什么方法可以做到这一点吗?

0 个答案:

没有答案