ajax成功函数是打印[object Object]而不是纯文本.为什么?

don*_*yor 5 java ajax jquery playframework-2.0

jQuery代码:

function ajaxsubmit(){
$.ajax({
    url: "/update",
    type: "POST",
    dataType: "html"
}).success(function(data) {
      $('#result').html(data);
  });
}
Run Code Online (Sandbox Code Playgroud)

和我的Java功能:

public static Result ajaxupdate() {
    String done = "very good";
    return ok("very good").as("text/plain");
}
Run Code Online (Sandbox Code Playgroud)

提醒[object Object]而不是纯文本"very good".为什么?

Cri*_*ufu 2

添加 dataType: "text" 并将complete() 更改为success()

function ajaxsubmit(){
    $.ajax({
        url: "/update",
        type: "POST",
        dataType: "html"
    }).success(function(data) {
          $('#result').html(data);
      });
    }
Run Code Online (Sandbox Code Playgroud)