Ibm mobilefirst 工具栏按钮未触发事件

Ibm mobilefirst 工具栏按钮未触发事件,ibm-mobilefirst,Ibm Mobilefirst,我有一个事件捕捉者: WLJQ('button#refreshBte').bind('click', function() { console.log("start refresh..."); }); 谁能解释一下为什么: is与以下方面合作: <div data-dojo-type="dojox.mobile.Heading" data-dojo-props='fixed:"top"'> Header

我有一个事件捕捉者:

    WLJQ('button#refreshBte').bind('click', function() {
        console.log("start refresh...");
    });
谁能解释一下为什么:

is与以下方面合作:

    <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>

标题
刷新
如果我用一个按钮替换工具栏按钮,也不会

Thx


编辑: 由于它不适合我,我创建了一个简单的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>

试验
window.$=window.jQuery=WLJQ;
标签
“页面设计器”显示标题和工具栏,但当我在Android模拟器上运行它时,我看到了一个黑屏!
知道吗?

可能是因为您使用JQuery语法绑定了事件

使用以下Dojo代码,相同的标记对我来说很好:

require([
    "dojo/ready",
    "dijit/registry"
], function(ready, registry){
    ready(function(){
        registry.byId("refreshBte").on("click", function(){
            console.log("start refresh...");
        });
    });
});

我会尝试一下,但同时你认为我的JQuery是正确的吗?我尝试过,但我无法在Android上显示小部件,因此我创建了一个简单的WL项目进行测试(见上面的html),但在Android上出现了一个黑屏。不知道为什么?这将有助于我进一步调查。谢谢