windows.location.href not working on Firefox3

前端 未结 17 1168
囚心锁ツ
囚心锁ツ 2020-11-30 07:31

We have a JavaScript function named \"move\" which does just \"windows.location.href = any given anchor\".
This function works on IE, Opera and Safari, but so

17条回答
  •  旧时难觅i
    2020-11-30 08:27

    You've got to add return false; after the window.location.href as mentioned above.

    function thisWorks()
    {
        window.location.href = "http://www.google.com";
        return false;
    }
    
    function thisDoesNotWork()
    {
        window.location.href = "http://www.google.com";
    }
    

提交回复
热议问题