我在ajax调用json中得到parsererror语法错误:无效的字符

时间:2014-09-11 06:11:52

标签: javascript ajax json

这是我的代码

   $.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
   }); 

1 个答案:

答案 0 :(得分:0)

尝试像这样调用

 $.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
  });