easyUI parser的使用:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script src="easyui/jquery.min.js"></script> <script src="easyui/jquery.easyui.min.js"></script> <script src="easyui/locale/easyui-lang-zh_CN.js"></script> <script src="js/test002.js"></script> <link rel="stylesheet" href="easyui/themes/default/easyui.css"> <link rel="stylesheet" href="easyui/themes/icon.css"> </head> <body> <div id="box" class="easyui-dialog" style="400px;height:200px">this is a dialog</div> </body> </html>
test002.js
//设置为false就不会自动解析class=easyui-dialog中的对象 $.parser.auto = false; $(function(argument) { //手动进行解析; $.parser.parse(); //这种方式竟然无法正常工作; $.parser.parse('#box'); }); $.parser.onComplete = function(argument) { //解析完毕之后的事件; console.log('parse is over'); };