WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: -[__NSArrayM objectForKey:]: unrecognized s

时间:2023-03-08 18:13:23
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style_box_demo.css">
<script type="text/javascript" src="merge.js"></script>
<script type="text/javascript" charset="utf-8"> <!--frame 位置-->
<!--type: 折线图 柱状图 饼状图-->
<!--ymax y轴最大值-->
<!--xtitles x轴下面的标题-->
<!--dataSource 数据源组-->
<!--{-->
<!-- piePercentValue 数值-->
<!-- color 颜色-->
<!-- text 关联名-->
<!-- project 关联项目名-->
<!-- plots 点集合-->
<!-- isShowPoint 显示点-->
<!--}--> function createchart() { var options = {
"frame" : [,,,],
"type":,
"ymax":,
"isShowPoint":,
"xtitles" :["", "", "", "", "", "", "", "" , "", "", "", ""],
"dataSource" :[
{
"piePercentValue": "",
"color": [, , ],
"text":"1组",
"project":"1组",
"plots":["", "", "", "", "", "", "", "" , "", "", "", ""]
},
{
"piePercentValue": "",
"color": [, , ],
"text":"2组",
"project":"2组",
"plots":["", "", "", "", "", "", "", "" , "", "", "", ""]
},
{
"piePercentValue": "",
"color": [, , ],
"text":"3组",
"project":"3组",
"plots":["", "", "", "", "", "", "", "" , "", "", "", ""]
}
]
}; showChartView.chartutility(testSuccess,testFailed,[options]);
} function testSuccess(msg) {
alert(msg);
}
function testFailed(msg) {
alert('failed: ' + msg);
} function goHome()
{
cordova.exec(testSuccess,testFailed,"ChartUtilityPlugin","remove");
window.location.href = "index.html";
}
</script> </head> <body>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<div class="btn bg_5" onclick="createchart();">生成图表</div><br/>
<div class="btn bg_1" onclick="goHome();">返回</div><br/> </body> </html>

出现这种报错的原因是

                showChartView.chartutility(testSuccess,testFailed,[options]);

数据类型错误,这里去掉括号即可,已经声明的参数等同于["xxxx"]

                showChartView.chartutility(testSuccess,testFailed,options);