Home  >  Article  >  Web Front-end  >  Prevent the login page from appearing in the frame js code_javascript skills

Prevent the login page from appearing in the frame js code_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:41:321471browse

When using frame page for nested development, when the server is restarted, the login page will appear in the frame page,

So you need to use js to determine the current address information on the login page, and then jump to a separate login page.

js code is as follows:

$("document").ready(function(){ 
//防止在frame里面出现登录页面 
if(top.location!==self.location){ 
//alert(top.location); 
//alert(self.location); 
top.location.href=self.location.href; 
} 
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn