我是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);