防止登录页面出现在frame中js代码

使用frame页面嵌套,重启了服务器的时候会出现登录页面在frame页面中出现,解决方法是在登录页面里面用js判断下当前的地址信息

在使用frame页面嵌套开发的时候,遇到重启了服务器的时候会出现登录页面在frame页面中出现,

所以需要在登录页面里面用js判断下当前的地址信息,然后跳转到登录的单独页面中。

js代码如下:

$("document").ready(function(){ //防止在frame里面出现登录页面 if(top.location!==self.location){ //alert(top.location); //alert(self.location); top.location.href=self.location.href; } });

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgpyss.html