我正在使用此锚标签重定向页面。但是当导航到android中的下一页时,我会看到白屏。
<a href="#" onclick="login()" class="btnSignIn" rel="external" data-ajax="false">Sign In</a>
答案 0 :(得分:0)
您必须在document.ready事件中绑定您的函数才能正常工作。请在deviceready函数中定义所有单击事件,然后它将正常工作。
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function() {
//call your click function here
});
}
};