簡體   English   中英

當我單擊瀏覽器中的后退按鈕時,我需要將上一頁重新加載到“另一個 URL”

[英]I need to reload the previous page to 'another URL' when I click on back button in browser

Suppose now I'm in google.com the I typed facebook.com in same page then from this page I clicked browser back button, then I need to load gmail.com instead of google.com . 我需要JavaScript/JQuery code

任何人都請幫助解決這個問題。 非常感謝提前....<3

我得到了答案。

<script type="text/javascript">
    $(document).ready(function() {
        if(performance.navigation.type == 2){
 window.location.replace("www.google.com");
}

 </script>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM