zoukankan      html  css  js  c++  java
  • WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[__NSArrayM objectForKey:]: unrecognized s

    <!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" 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);
    
  • 相关阅读:
    jascript基础教程学习总结(2)
    ajax原理图解
    ajax原理
    javascript基础教程学习总结(1)
    HTML学习(1)
    vi编辑器
    effective C++ 4 Make sure objects are initialized before they are used
    effective C++ 3 use const whenever possible
    STL: string:erase
    STL: 从reverse到iterator
  • 原文地址:https://www.cnblogs.com/OIMM/p/9405177.html
Copyright © 2011-2022 走看看