2010-09-19 132 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