本文為大家彙整了幾種 JavaScript 重新整理視窗的方法,希望對學習中的朋友有所幫助。
1. 重新整理父視窗
<script>
function reflushParent(){
window.opener.location.reload();
}
</script>
2. 重新整理目前視窗
<script>
function reflushMe(){
javascript:location.reload();
}
</script>
3. 重新整理目前視窗(新寫法)
<script language='javascript'> var currentUrl = this.location.href var currentQuery = this.location.search window.location.href=currentUrl +currentQuery </script>
4. 重新整理目前視窗並附加一個參數
<script language='javascript'> var currentUrl = this.location.href var currentQuery = this.location.search window.location.href=currentUrl +currentQuery +"&language=English" </script>
希望本文所述能對大家的 JavaScript 程式設計有所幫助。