jQuery 重新加载 div 的内容(动态渲染)

标签 jquery plugins refresh reload

我有一个通过表达式引擎生成 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/

相关文章:

Python Gtk TreeView ;选择项目时如何刷新列表

java - 如何从 JavaBean 刷新 jsf 页面

javascript - 选择具有特定属性的 Web 表单元素

javascript - 使用 Backbone LayoutManager 的冗余 div

javascript - jQuery.inArray 返回 -1,无论值如何

java - 在 Eclipse 中分析 Java 应用程序? (插入)

android - Cordova 可选择在安装或 CDN 上加载插件/库 - Android 和 iOS

服务停止时Android更新当前 Activity

javascript - 如何每 3 秒调用一个函数 15 秒?

asp.net - 如何在插件中获取模拟用户 ID?