0

结果

  • 它总是停在“APACHE CORDOVA 连接到设备”
  • 我不知道为什么...

我的脚步

这是我的 index.js 的一部分:

receivedEvent: function(id) {
    var parentElement = document.getElementById(id);
    var listeningElement = parentElement.querySelector('.listening');
    var receivedElement = parentElement.querySelector('.received');
    listeningElement.setAttribute('style', 'display:none;');
    receivedElement.setAttribute('style', 'display:block;');

    document.onclick = function() {
        CDV.WEBINTENT.startActivity({
            action: CDV.WEBINTENT.ACTION_VIEW,
            url: 'geo:0,0?q=' + 'new york'
        },
        function() {}, function() {
            alert('Failed to open URL via Android Intent')
        })
    }
}
4

1 回答 1

0

您的代码中有多个},;内部。

receivedEvent: function(id) {
    var parentElement = document.getElementById(id);
    var listeningElement = parentElement.querySelector('.listening');
    var receivedElement = parentElement.querySelector('.received');
    listeningElement.setAttribute('style', 'display:none;');
    receivedElement.setAttribute('style', 'display:block;');
    console.log('Received Event: ' + id);
    //I just try to launch a map view app.
    document.onclick = function() {
        alert(new Date);
        CDV.WEBINTENT.startActivity({
            action: CDV.WEBINTENT.ACTION_VIEW,
            url: 'geo:0,0?q=' + 'new york'
        }, function() {}, function() {
            alert('Failed to open URL via Android Intent')
        });
    }
}
于 2014-06-06T18:31:03.770 回答