我是 html 和 highchart 的新手,我想问是什么导致了这个错误?我正在为android开发这个,我被困在这里。任何意见和答案将不胜感激。
03-25 08:15:49.827: E/Web Console(692): SyntaxError: Parse error at file:///android_asset/www/index.html:35
下面是我的html文件
html
<!DOCTYPE HTML>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/highcharts.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/modules/exporting.js" type="text/javascript"> </script>
<title>My HTML</title>
</head>
<body>
<script type="text/javascript" charset="utf-8">
$(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]
}]
});
}); <---------------Line 35
</script>
<div id="container" style="height: 300px"></div>
</body>
</html>
活动
webView = (WebView)findViewById(R.id.webView);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("file:///android_asset/www/index.html");
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);