2010-03-25 42 views
0
<script type="text/javascript"> 

if (window.name == 'default') { 
     window.name = 'a03d01c6c88549c6a7e05c922961271e'; 
     window.document.getElementById('ctl03').click(); 
    } 
    else if (window.name == '') { 
     window.name = 'default'; 
     window.document.getElementById('ctl04').click(); 
    } 
    else if (window.name == 'invalidAccess') { 
     if ('FALSE' == 'TRUE') 
     { 
     window.name=''; 
     window.document.getElementById('ctl04').click(); 
     } 
     else 
     { 
      window.open('MsgPage_NewWindow.aspx','_self'); 
     } 
    } 
    else { 
     window.name = 'invalidAccess'; 
     window.document.getElementById('ctl04').click(); 
    } 
</script> 

上述腳本由服務器控制發出的網頁上運行的網頁...有一個在頁面沒有其他控制除了該頁面... Internet Explorer將其重定向到「Home.aspx」頁面,但Firefox只停留在同一頁面中...注意它顯示任何錯誤。爲什麼這段JavaScript代碼不能在Firefox

請你幫忙。我也想知道爲什麼如此,因爲我必須使整個Web應用程序在FF中工作。

回答

4

您正在使用專有的IE-only click方法重定向。

您應該改爲寫location.href = "http://url";;這將在每個瀏覽器中工作。

+0

非常感謝... – 2010-03-26 03:31:46

1

您正在查看Tools-> Error Console下?如果你這樣做,你會看到像「點擊不是一個功能」,只需設置.location。

相關問題