我在对json SyntaxError的ajax调用中得到了parserror:无效字符

i am getting parsererror in ajax call to json SyntaxError: Invalid character

本文关键字:parserror 字符 无效 调用 json SyntaxError ajax      更新时间:2023-09-26

这是我的代码

   $.ajax({
       type: 'GET',
       url: "<%=request.getContextPath()%>/manageUsers.do",
       cache: false,
       data:{ "resultType": "json", "submit": $.i18n.prop('esadmin.manage.users.delete-btn'), "OID": oid },
       invokedata: { "OID": oid, "username": username },
       contentType: "application/json",
       dataType: "text",
       success:  deleteUserSuccess,
       error: deleteUserError
   }); 

试着像这样调用

 $.ajax({
       type: 'GET',
       url: "<%=request.getContextPath()%>/manageUsers.do",
       cache: false,
       data:{ "resultType": "json", "submit": $.i18n.prop('esadmin.manage.users.delete-btn'), "OID": oid },
       invokedata: { "OID": oid, "username": username },
       contentType: "application/json",
       dataType: "json",
       success:  deleteUserSuccess,
       error: deleteUserError
  });