我有一个通过Expression Engine生成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重新加载/刷新。
答案 0 :(得分: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");
}
});
答案 1 :(得分:1)
jQuery的“操作”部分中列出的任何方法都可以满足您的需求:http://docs.jquery.com/Manipulation
答案 2 :(得分:0)
你的漂亮淡出
success : function(data) {
$("#panel").hide().html(data).fadeIn('fast');
}