2010-08-07 75 views
4

我应该从服务器回应什么数据以重新定向我的页面?再说了,想这我的jquery: -如何重定向页面? jQuery

$.ajax({ 
      type: "POST", 
      url : '<?php echo base_url() ?>Admin/AddNotice', 
      data: {noticeTitle: $('#title').val(),noticeDesc : $('#desc').val() }, 
      success: function(msg){ 
       //here i want to redirect..fill in the blank please. 
      } 
     }); 

感谢提前:)

+11

“ajaxically”是我最喜欢的词。 – 2010-08-07 15:10:14

回答

12

这是很容易:

window.location = "http://www.google.com"; 

;)

5

我不知道你是什么意思“ajaxically重定向”,但如果你只是想浏览器重定向到另一个页面,则可以使用window.location = 'http://wherever/you/want/to/go/';

7

使用:

success: function(msg){ 
    window.location = "page.html"; 
}