Encountering a persistent error when using Google Charts in IE8:
SCRIPT70: Permission denied format+en,default+en,ui+en,corechart+en.I.js, line 86 character 16
The issue arises while working with a parent page where the drawChart() function and global chartDatas array variable are utilized. Upon calling a child page through an ajax request and updating the chartDatas array, calling the drawChart() function triggers the aforementioned error in IE8, particularly when hovering over the page. This continuous error significantly impacts the functionality of the application. The following is a sample code snippet to replicate this problem in IE8 (works fine in modern browsers like Chrome, Firefox, IE10).
parentPage.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages: ["corechart"]});
google.setOnLoadCallback(drawChart);
var year = 2008;
var chartDatas = [
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
];
function drawChart() {
var data = google.visualization.arrayToDataTable(chartDatas);
var options = {
title: 'Company Performance',
vAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
};
var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function callChild() {
$.ajax({
url: "childJsp.jsp",
complete: function(res, textStatus) {
$('#childPage').html(res.responseText);
}
});
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
<br>
<input type="button" onclick="callChild();" value="call child page">
<div id="childPage"> </div>
</body>
</html>
childJsp.jsp
<script>
chartDatas.push([''+(year++), 900, 400]);
drawChart();
</script>
Upon loading the child page via ajax call, the error is logged in the console.