得到响应后,我想使用ajax调用刷新特定的div标签
<script> $(document).ready(function() { $('#add-new-department').submit(function(event) { var departmentname = $('#departmentname').val(); $.ajax({ url : $("#add-new-department").attr("action"), type : "POST", data : "departmentname="+departmentname, success : function(response) { $('#status').html(response); $('#departmentname').val(''); $('#department').load(""); } }); event.preventDefault(); }); }); </script>
我想在jsp页面中更新一条消息
<div id="department">Department Updated : <% new Date(); %> </div>
我的要求是像ajax调用后 刷新 div标签
$('#department').refresh();
$.ajax({ url : $("#add-new-department").attr("action"), type : "POST", data : "departmentname="+departmentname, success : function(response) { $('#status').html(response); $('#departmentname').val(''); $('#department').html('Department Updated: ' + new Date()); } });