2010-09-19 247 views
13

我试过不同的方法来做到这一点,但我不能得到它的工作。这是代码:关闭重定向jQuery UI对话框

$.ui.dialog.defaults.bgiframe = true; 
$(function() { 
    $("#category_edit_dialog").dialog({ 
     width: 960, 
     hide: 'slide', 
     position: 'top', 
     show: 'slide', 
     close: function(event, ui) { redirect here? how? } 
    }); 
    }); 
}); 

谢谢dekomote帮助我。在他的建议我解决了这个问题:这里是完整的工作代码:

$.ui.dialog.defaults.bgiframe = true; 
$(function() { 
    $("#category_edit_dialog").dialog({ 
     width: 960, 
     hide: 'slide', 
     position: 'top', 
     show: 'slide', 
     close: function(event, ui) { location.href = 'url here' } 
    }); 
}); 
+3

你尝试位置的页面.href ='你想重定向的地方' – dekomote 2010-09-19 11:16:31

回答

21
$.ui.dialog.defaults.bgiframe = true; 
    $(function() { 
     $("#category_edit_dialog").dialog({ 
      width: 960, 
      hide: 'slide', 
      position: 'top', 
      show: 'slide', 
      close: function(event, ui) { window.location.href = "page.html"; } 
     }); 
     }); 
    }); 

,其中“page.html中”是你想重定向到接近

+0

我已经得到它的工作感谢dekomote,但你的代码的作品以及:)谢谢! – ciprian 2010-09-19 11:38:54