2011-03-18 23 views

回答

5

這是你如何設置幀(top)在框架文件的位置的父...

top.location = self.location; 

當然,這個代碼必須在iframe中執行,並且是succeptible到Same-Origin Policy

0

window.top.location將您返回到broswer的地址欄位置,即使您在i-frame或page中。 window.location是返回facebook應用程序當前頁面地址的位置。如果你想頂部查詢字符串,你必須使用

alert(window.top.location);

如果u想更換頂部位置,然後

window.top.location = "http://whatever.com";