成功的Ajax帖子后,我希望使用JQuery的.load()方法呈现处理程序中与POST关联的模板。 GET请求在POST成功后不断被调用...所以与GET相关的模板得到渲染,而不是与POST关联的模板。感谢您提供的任何提示。ajax post成功后,如何使用JQuery .load()方法发送POST请求
的Javascript:
$(function() {
$(".topic_submit").click(function() {
var topic = $("#topic").val();
refresh = 'false'
$.ajax({
type: "POST",
url: "/mentorlist",
data: {'topic': topic},
success: function(dataString) {
$('#mentor_list').load('/mentorlist');
console.log('**mentor_list div updated via ajax.**');
}
});
return true;
});
});
HTML表单:
Topic: