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')
})
}
}
答案 0 :(得分: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')
});
}
}