WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:...

 

 

<!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:1  折线图  2 柱状图  3 饼状图-->
<!--ymax  y轴最大值-->
<!--xtitles  x轴下面的标题-->
<!--dataSource  数据源组-->
<!--{-->
<!--    piePercentValue  数值-->
<!--    color  颜色-->
<!--    text    关联名-->
<!--    project   关联项目名-->
<!--     plots   点集合-->
<!--     isShowPoint   显示点-->
<!--}-->
     

            function createchart() {
                
                var options = {
                    "frame" : [0,104,375,200],
                    "type":1,
                    "ymax":1000,
                    "isShowPoint":1,
                    "xtitles" :["1", "2", "3", "4", "5", "6", "7", "8" , "9", "10", "11", "12"],
                    "dataSource" :[
                                   {
                                   "piePercentValue": "10",
                                   "color": [200, 0, 135],
                                   "text":"1组",
                                   "project":"1组",
                                   "plots":["200", "800", "500", "300", "1000", "600", "100", "300" , "500", "600", "700", "800"]
                                   },
                                   {
                                   "piePercentValue": "20",
                                   "color": [10, 50, 205],
                                   "text":"2组",
                                   "project":"2组",
                                   "plots":["700", "300", "400", "500", "300", "500", "700", "800" , "900", "800", "400", "600"]
                                   },
                                   {
                                   "piePercentValue": "20",
                                   "color": [0, 40, 135],
                                   "text":"3组",
                                   "project":"3组",
                                   "plots":["800", "300", "600", "900", "600", "700", "600", "500" , "400", "300", "900", "600"]
                                   }
                                   ]
                };

                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" οnclick="createchart();">生成图表</div><br/>
        <div class="btn bg_1" οnclick="goHome();">返回</div><br/>

    </body>
    
    
</html>

出现这种报错的原因是

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

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

                showChartView.chartutility(testSuccess,testFailed,options);

 

转载于:https://www.cnblogs.com/OIMM/p/9405177.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值