我有一个关于在网站上显示下一页的问题。我使用jQuery并希望在按Enter键的情况下显示下一页?我如何才能做到这一点。下面的代码已经显示了我所写的内容。有没有什么方法可以做得很好?
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
$(document).on("keypress", "input", function(e){
if(e.which == 13){
}
});
</script>发布于 2019-05-26 23:48:52
您可以使用window.location重定向到另一个页面:
window.location = "http://www.google.com" // set your next page url instead of www.google.com发布于 2019-05-29 18:22:33
window.location.replace("http://stackoverflow.com"); or
window.location.href = "http://stackoverflow.com"; or
window.open(url, '_blank');https://stackoverflow.com/questions/56313966
复制相似问题