我有一个jquery模式确认框,我添加了一个注册和登录按钮(我只是从手册中复制了一个)..now问题是,
1)单击注册按钮后,我想显示另一个弹出框,该弹出框将包含此ajax驱动的模块
<div id="registerpopup">
<?php
if($_GET['t']=='l')
{
$the_class->Lostpword('pword_embed');
}
elseif($_GET['t']=='b')
{
$the_class->Lostpword('unamepword_embed');
}
elseif($_GET['t']=='n')
{
//$the_class->Lostpword('pword_embed');
$the_class->Registration('unamepword_embed_next');
}
elseif($_GET['t']=='r')
{
//$the_class->Lostpword('pword_embed');
$the_class->Registration('register_embed');
}
else
{
$the_class->Lostpword('accn_help');
}
?>
</div>2)一旦ajax驱动的模块出现,确认框就会关闭。
3)当用户注册成功后,如何关闭这个新的弹窗并自动刷新页面,因为我的app中的每个注册用户都应该自动登录。
这是我的确认框代码
if(userid == ""){
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-confirm" ).dialog({
resizable: false,
height: 230,
width: 350,
modal: true,
buttons: {
"Register": function(){
$(this).dialog("close");
},
"Log in": function() {
$(this).dialog("close");
}
}
});
return false;
}发布于 2011-08-10 22:35:58
// Inside confirm modal code
// On click of register button...
$('#confirm_register_btn').click(function(){
// ... close the confirm box
$('#confirm_box').hide();
});
// Inside register modal code
$.ajax({
url: '/path-to-register.php',
data: ...
dataType: ...
type: 'post',
success:function(data){
// Example, data = 'Registration successful'
// Let the user know...
$('body').html(data + ' -- Please wait while we redirect you');
// Reload page
window.location.reload();
}
});https://stackoverflow.com/questions/7012433
复制相似问题