2011-04-04 80 views
0

我不太熟悉阿贾克斯,如果你能帮助我,这将是伟大的。阿贾克斯重新加载页面

以下脚本将数据发送到Codeigniter中的控制器并刷新页面,但是我想知道是否有一种方法可以在没有完全重新加载页面的情况下执行此操作......希望是有道理的。

'onComplete' : function (event, queueID, fileObj, response, data) { 
    $.post('<?=site_url('admin/news_manager/uploadify');?>',{filearray: response},function(info){ 
    location.reload(); 
}); 

回答

0

从您的脚本中省略location.reload();

但是,如果您希望页面的某些部分显示帖子中的数据,则需要将其插入页面中的某个位置。

换句话说:的

$("#IdOfTheHtmlElement').html(info);代替location.reload();

我希望这有助于。

+0

它的工作原理!非常感谢 :) – ae2011 2011-04-04 13:23:32