我遇到了.bind函数的问题,它在firefox和chrome中运行,但不适用于IE。本主题中提到的修复:How to handle lack of JavaScript Object.bind() method in IE 8不起作用。
我尝试用.on函数替换它,但在IE中也不起作用。该代码将在大学计算机上运行,因此不幸的是,旧的IE版本是预期的。
这段代码的另一部分是否可能阻止它工作? (注意:我也使用jqplot中的IE修复程序)
$('#chart').on('jqplotClick', function(event, seriesIndex, pointIndex, data) {
var xax = pointIndex.xaxis;
var yax = pointIndex.yaxis;
console.log("Coordinates according to chart location for plot1 : " + xax + " - " + yax);
myDataRef.push("Coordinates according to chart div for plot1 : " + xax + " - " + yax);
if (Math.round(xax) === 9) {
$('#info1').html("Your sales forecast for time period 9 is " + Math.round(yax) + " units.");
$('#proceed').show();
//add new datapoint and renew dataserie s3
plot1.series[1].data = [[1, 28], [2, 13], [3, 54], [4, 47], [5, 28], [6, 13], [7, 54], [8, 47], [xax, yax]];
//fill in replot/redraw!
plot1.drawSeries({},1);
}
//if they click outside of the 9th time period:
else {
alert("Please click within the correct grid lines (period 9)");
}
编辑:我找到了一个帮助:http://diogomelo.net/blog/12/javascript-compatibility-internet-explorer 的脚本