尝试做一个非常基本的 Highcharts ,但我不断收到错误:“第 42 行第 12 列处的 JavaScript 严重错误。SCRIPT1014:无效字符。我已在 header 中包含 jQuery,所以我不确定我是什么”我做错了。用 IE 测试。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"> </script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<title></title>
</head>
<body>
<div id="container" style="width:100%; height:400px;"></div>
<script type="text/javascript">
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
});
</script>
</body>
</html>
最佳答案
我有一个特殊字符“?”当我在最后一个分号之后复制您的代码时。 尝试在文本编辑器(对我来说是notepad++)中复制您的代码,删除此字符并再次复制您的页面。
它对我有用。
关于javascript - jquery 和 highcharts SCRIPT1014 : Invalid character 出现无效字符错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17428903/