我正在处理一个文件myfile.php
。在这个文件中,我有以下代码:
<button type='submit' name='refresh' onclick='refresh()'></button>
<script>
function refresh(){
setTimeout(window.location.href = "summary.php",1000);
}
</script>
当我单击刷新按钮时,我的窗口位置将更新,浏览器将加载文件summary.php
。但是,我想继续使用myfile.php
,并在第二个选项卡中刷新文件summary.php
。
发布于 2019-10-15 17:50:22
您可以尝试这样做:
<script type="text/javascript">
$(document).ready(function() {
if(performance.navigation.type == 2){
window.location.replace("www.google.com");
}
</script>
https://stackoverflow.com/questions/53712244
复制相似问题