1. 程式人生 > >防止登錄頁面出如今frame中

防止登錄頁面出如今frame中

重新啟動 例如 popu javascrip name asc 重新 pre 出現

在使用frame頁面嵌套開發的時候,遇到重新啟動了server的時候會出現登錄頁面在frame頁面中出現,

所以須要在登錄頁面裏面用js推斷下當前的地址信息,然後跳轉到登錄的單獨頁面中。


js代碼例如以下:

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

				
			});

防止登錄頁面出如今frame中