4

我有一个通过表达式引擎生成 html 的 div。我正在使用ajax提交:

$('#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

3 回答 3

4

我假设您正在寻找类似的东西:

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

使固定:

$('#login-form').ajaxForm({ 
    target: '#panel', //Will update the "#panel"
    success: function( data) { 
    alert( "Success");
    } 
});
于 2009-05-31T20:30:00.387 回答
1

jQuery 的“操作”部分中列出的几乎所有方法都会做你想做的事:http: //docs.jquery.com/Manipulation

于 2009-05-31T20:46:25.143 回答
0

为了你漂亮的淡入淡出

success : function(data) {
   $("#panel").hide().html(data).fadeIn('fast');
} 
于 2009-05-31T20:50:29.300 回答