我有一个通过表达式引擎生成 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。
最佳答案
我假设您正在寻找类似的东西:
$('#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");
}
});
关于jQuery 重新加载 div 的内容(动态渲染),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/932777/