Recently, I encounter a problem when implement my web app on SharePoint with IE8. Since the default broswer for my SharePoint is IE8 and this is unchangeable for my situration.
Please click the following link with my look on my flow of application
what my problem pop-up is when I clicked the plot of the line
- sp.core.js?rev=7ByNlH%2BvcgRJg%2BRCctdC0w%3D%3D:2 Uncaught TypeError: a.indexOf is not a function(…)
Although chrome is encounter this error as well, it worked well if you ignore the error. But IE8 will stop me immediately.
What I found on google, the way of handling indexOf() in IE8 is adding following script in my 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;
};
}
But where should I add? before the or after loaded all JS library?
<!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>
Is there any way that I can do it without edit any code in the sharepoint core javascript?