我有这个事件捕捉器:
WLJQ('button#refreshBte').bind('click', function() {
console.log("start refresh...");
});
有人可以解释一下为什么:
适用于:
<div data-dojo-type="dojox.mobile.Heading"
data-dojo-props='fixed:"top"'>
Header
</div>
<button id="refreshBte" data-dojo-type="dojox.mobile.Button"
style="float: right">Refresh</button>
并且不适用于:
<div data-dojo-type="dojox.mobile.Heading"
data-dojo-props='fixed:"top"'>
Header
<button id="refreshBte" data-dojo-type="dojox.mobile.ToolBarButton"
style="float: right">Refresh</button>
</div>
如果我用按钮替换 ToolBarButton 也不会。
谢谢
编辑:因为它不适合我,所以我创建了一个简单的 WL 项目并添加了标题和工具栏按钮,这里是 html:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="stylesheet" href="css/Test.css">
<script>
window.$ = window.jQuery = WLJQ;
</script>
<script type="text/javascript"
data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false"
src="dojo/dojo.js"></script>
</head>
<body id="content" style="display: none;">
<div data-dojo-type="dojox.mobile.ScrollableView" id="view0"
data-dojo-props="selected:true">
<div data-dojo-type="dojox.mobile.Heading"
data-dojo-props="label:'Heading'">
<button data-dojo-type="dojox.mobile.ToolBarButton" id="refreshBte">Label</button>
</div>
</div>
<!--application UI goes here-->
<script src="js/initOptions.js"></script>
<script src="js/Test.js"></script>
<script src="js/messages.js"></script>
</body>
</html>
“页面设计器”显示了标题和工具栏,但是当我在 Android 模拟器上运行它时,我得到了一个黑屏!任何想法?