场景是我在表单元素上编写了一个自动刷新功能,我想在登录按钮上点击onclick事件来禁用自动刷新功能.
我无法禁用autorefresh,页面仍然刷新.
我的代码是:
$('#form').ready(function () { //Increment the idle time counter every minute.
var idleInterval = setInterval("timerIncrement()", 15000); // 1 minute
//Zero the idle timer on mouse movement.
$(this).mousemove(function (e) {
idleTime = 0;
});
$(this).keypress(function (e){
idleTime = 0;
});
});
function timerIncrement() {
idleTime = idleTime + 1;
if (idleTime > 2) { // 20 minutes
window.location.reload();
}
}
$('#login').ready(function () {
alert("working promptly");
//Zero the idle timer on mouse movement.
$(this).click(function (e) {
alert("Hi In click !"); …Run Code Online (Sandbox Code Playgroud) 我有自动刷新wicket页面的场景,但它是基页,所有页面都在扩展它.我不想刷新所有扩展页面只有基页.
现在我正在使用html元标记.它正在刷新所有页面.是否可以只刷新基页