Jquery 登录后,Colorbox重定向到父窗口中的url
我正在使用colorbox作为登录窗口,一旦成功,我想将用户重定向到父框架中的index.php。我遗漏了一些细节,它在colorbox中重定向index.php。在哪里声明目标的“parent”参数 我正在发布我的代码中启用颜色框等的部分: 打开颜色框的链接:Jquery 登录后,Colorbox重定向到父窗口中的url,jquery,colorbox,Jquery,Colorbox,我正在使用colorbox作为登录窗口,一旦成功,我想将用户重定向到父框架中的index.php。我遗漏了一些细节,它在colorbox中重定向index.php。在哪里声明目标的“parent”参数 我正在发布我的代码中启用颜色框等的部分: 打开颜色框的链接: $(document).ready(function() { $("a.logmein").colorbox({rel: 'logmein', iframe:true, width:"540", height:"400", onC
$(document).ready(function() {
$("a.logmein").colorbox({rel: 'logmein', iframe:true, width:"540", height:"400", onClosed:function(){ location.reload(true); }});
});
检查用户的凭据:
if($totalRows_finduser==0){
echo '<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$.colorbox({href:\'login.php\', iframe:true, transition:"fade", width:"540", height:"400"});
});
</script>';
} else {
$_SESSION['login'] = 1;
// I set the user as logged in, assign the session vars etc
// HOW DO I REDERECT HIM FROM HERE TO PARENT??
}
if($totalRows\u finduser==0){
回声'
$(文档).ready(函数(){
$.colorbox({href:\'login.php\',iframe:true,过渡:“淡入”,宽度:“540”,高度:“400”});
});
';
}否则{
$\u会话['login']=1;
//我将用户设置为已登录,分配会话变量等
//我该如何把他从这里重新引导到父母那里??
}
也许有不同的想法。为什么要将路由(重定向)作业分配给登录弹出窗口
考虑使弹出窗口的工作(i)获取登录凭据并(ii)对其进行身份验证。如果凭据失败,请停留在弹出窗口中。如果通过,则关闭将操作结果传递回父级的弹出窗口。让父节点在那里执行路由
您还应该考虑终端用户只需关闭登录弹出窗口的情况;要么防止这种情况发生,要么向父级添加覆盖该情况的信号
如果您希望从弹出窗口中进行路由,请记住您可以访问父窗口对象。因此,用一些URI加载window.parent.locationkjm谢谢!效果很好。window.parent.location。额外的赏金;)