2009-05-31 103 views
4

我有一个通过表达式引擎生成html的div。我正在使用ajax提交:jQuery重新加载div的内容(动态呈现)

$('#login-form').ajaxForm({ 
    // success identifies the function to invoke when the server response 
    // has been received; here we apply a fade-in effect to the new content 
    success: function() { 
    $("#panel").RELOAD!!();//Just refresh this div! 
    } 
}); 

我只想#panel div重新加载/刷新。

回答

4

我假定你正在寻找类似的东西:

$('#login-form').ajaxForm({ 
    success: function(data) { 
    $("#panel").html(data);//Will insert new content inside div element. 
    } 
}); 

FIX:

$('#login-form').ajaxForm({ 
    target: '#panel', //Will update the "#panel" 
    success: function(data) { 
    alert("Success"); 
    } 
}); 
+0

Expression Engine在提交后会自动返回。我不知道这是否工作...我认为这是,但EE尝试重新加载整个页面出于某种原因... – 2009-05-31 23:28:17

+0

这是jQuery 1.3的具体? – 2009-06-01 02:48:50

0

而你漂亮的褪色

success : function(data) { 
    $("#panel").hide().html(data).fadeIn('fast'); 
}