function publishTopic(){
var subjectId = $("#subjectId").attr("value");
var topicContent = $("#topicContent").val();
if (topicContent==null || typeof(topicContent)=="undefined" || topicContent==""){
alert("评论内容不能为空!!!");
}
$.ajax({
url: "/topic/publishTopic.action",
type: "POST",
data: "topicAbstractInfoVO.belongSubjectId="+subjectId+"&r="+ (new Date()).getTime(),
dataType: "json",
async:true,
success: function(reMsg){
alert(reMsg);
console.log("111"+reMsg);
var a=0
var b=1;
b=a+b;
alert("111111111");
/*if(reMsg.success==true){
window.location.href = "/index.action?topicAbstractInfoVO.belongSubjectId="+subjectId
ajax请求不等服务器返回直接进入error
最新推荐文章于 2022-08-01 16:22:12 发布
本文描述了一个Ajax请求在服务器未完成响应时直接进入error的情况。问题出现在使用a标签并触发onclick事件时,若href未设置为'#',会导致请求异常。通过将a标签的href属性设为'#',问题得到解决。
摘要由CSDN通过智能技术生成