是否可以在调用 onClick 时和启动 location.href 之前将类切换到加载图形并禁用按钮?有延迟,我希望避免双击。有人可以给我看这个样本吗?
<button type="button" class="MoreTides" onclick="location.href='http://www.domain.com/tides/parser_iphone.php?stats=$xml->stationid'">View Graph - Change Dates</button>
是否可以在调用 onClick 时和启动 location.href 之前将类切换到加载图形并禁用按钮?有延迟,我希望避免双击。有人可以给我看这个样本吗?
<button type="button" class="MoreTides" onclick="location.href='http://www.domain.com/tides/parser_iphone.php?stats=$xml->stationid'">View Graph - Change Dates</button>
这样的事情可能是一个开始:
<script>
function loadPage(input) {
input.disabled = true;
input.className = "loadingButton"; // define how this should look in CSS
location.href='http://www.domain.com/tides/parser_iphone.php?stats=$xml->stationid';
}
</script>
<button type="button" class="MoreTides" onclick="loadPage(this)">View Graph - Change Dates</button>