1. 程式人生 > >登入資訊失效,防止登入介面顯示在frame中

登入資訊失效,防止登入介面顯示在frame中

在使用frame頁面巢狀開發的時候,遇到重啟了伺服器的時候會出現登入頁面在frame頁面中出現,

所以需要在登入頁面裡面用js判斷下當前的地址資訊,然後跳轉到登入的單獨頁面中。

$("document").ready(function(){
	//防止在frame裡面出現登入頁面
	if(top.location!==self.location){ 
		//alert(top.location); 
		//alert(self.location); 
		top.location.href=self.location.href; 
	} 
 
				
});