waves
waves
  • 发布:2014-12-19 23:33
  • 更新:2015-06-08 18:46
  • 阅读:5471

Uncaught TypeError: Cannot call method 'evalJS' of undefined at js/mui.min.js:7

分类:MUI
mui

mui("#msglist").pullRefresh().endPulldownToRefresh();
//有这句就会报错 【Uncaught TypeError: Cannot call method 'evalJS' of undefined at js/mui.min.js:7】

<!DOCTYPE html>  
<html>  

    <head>  
    <meta charset="utf-8">  
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />  
        <title></title>  
        <script src="js/mui.min.js"></script>  
        <link href="css/mui.min.css" rel="stylesheet" />  
    </head>  

    <body>  
        <header class="mui-bar mui-bar-nav" style="background-color:#F64141">  
            <h1 class="mui-title" style="color: #FFFFFF;font-family: '微软雅黑';font-size: 1em;">我的持仓</h1>  
        </header>  
        <div class="mui-content" style="background-color: #FFFFFF;">  

            <div id="msglist">  
                <hr>  
            </div>  
        </div>    
        <script type="text/javascript">  
    mui.init({  
        pullRefresh: {  
            container: '#msglist', //待刷新区域标识,querySelector能定位的css选择器均可,比如:id、.class等  
            down: {  
                contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容  
                contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容  
                contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容  
                callback: load_up_data //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;  
            },  
            up: {  
                contentrefresh: '正在加载...',  
                callback: load_down_data  
            }  
        }  
    });  

    mui.plusReady(function() {  
        load_up_data();  
        load_up_data();  
    });  

    var pageNo = 0;  

    function load_up_data() {  
            var div = document.getElementById("msglist");  

            setTimeout(function() {  
                    console.log('ddddd');  
                    mui('#msglist').pullRefresh().endPulldownToRefresh(); //refresh completed  
                }, 1500);  

            //mui("#msglist").pullRefresh().endPulldownToRefresh(); //有这句就会报错  【Uncaught TypeError: Cannot call method 'evalJS' of undefined at js/mui.min.js:7】  

            }  

            function load_down_data() {  
                pageNo++;  

            }  
</script>  
    </body>  

</html>
2014-12-19 23:33 负责人:无 分享
已邀请:
best

best

同问
Uncaught TypeError: Cannot call method 'evalJS' of undefined at js/mui.js:4013

吴静

吴静 - 测试

求解答!!!????

  • DCloud_UNI_CHB

    你也出现同样错误了?这个帖子已经很老了,未必是一样的错误;建议上传测试demo;

    2015-06-08 18:26

kaiven

kaiven

不能直接 调用 load_up_data
否则 call
mui('#msglist').pullRefresh().endPulldownToRefresh()
会出现这个错误

DCloud_UNI_FXY

DCloud_UNI_FXY

必须使用双webview

该问题目前已经被锁定, 无法添加新回复