Uncaught SyntaxError: missing ) after argument list when trying to add a function to sort data

Uncaught SyntaxError: missing ) after argument list when trying to add a function to sort data

我遇到错误:

Uncaught SyntaxError: missing ) after argument list

与下面 Javascript:

jQuery.extend(cipMonitorErrorsSettings, {
    loadOnStartup: true,
    columnDefs: [{
        "mData": "createdDate",
        "bSortable": true,
        "sTitle": '<fmt:message key="card.cipErrors.createdDate"/>',
        "mRender": function(data, type, cipErrors) { //new
          return '<button class="cipSummary buttonlink createdDate">' + cipErrors.createdDate + '</button>'; //new
        }
      },
      {
        "mData": "status",
        "bSortable": true,
        "sTitle": '<fmt:message key="card.cipErrors.status"/>'
      },
      {
        "mData": "jsonRequest",
        "sTitle": '<fmt:message key="card.cipErrors.jsonRequest"/>'
      },
      {
        "mData": "jsonResponse",
        "sTitle": '<fmt:message key="card.cipErrors.jsonResponse"/>'
      }

    ],
    editLinks: [{ //Edit
      selector: ".cipSummary",
      callback: function(target, data) {
        //  debugger;
        $ {
          prefix
        }
        ActionFormHandler.open(data);
      },
      disabled: $ {
        actionBean.restricted['RESTRICT_EDIT']
      }

    }],
    postInitCallback: function() {
      console.log(this.container.find(".appendImage"));
    },
    actionButtons: {
      exportText: '<fmt:message key="export.csv"/>'
    }


  }
  $(document).ready(function(data) {
    $('#cipTable').DataTable({
      "order": [
        [3, "desc"]
      ],
      "columnDefs": [{
          targets: 0,
          data: "createdDate"
        },
        {
          targets: 1,
          data: "status"
        },
        {
          targets: 2,
          data: "jsonRequest"
        },
        {
          targets: 3,
          data: "jsonResponse"
        }
      ]
    })
  });
);

我已经反复检查并尝试了很多次,但仍然无法摆脱这个错误。我还添加了一个调试器,但可以找到它发生的位置。我正在尝试显示列,但按 createdDate 列排序。

像这样试试你的脚本,我删除了最后一个");"在脚本结尾。

jQuery.extend(cipMonitorErrorsSettings, {
    loadOnStartup: true,
    columnDefs: [{
        "mData": "createdDate",
        "bSortable": true,
        "sTitle": '<fmt:message key="card.cipErrors.createdDate"/>',
        "mRender": function(data, type, cipErrors) { //new
          return '<button class="cipSummary buttonlink createdDate">' + cipErrors.createdDate + '</button>'; //new
        }
      },
      {
        "mData": "status",
        "bSortable": true,
        "sTitle": '<fmt:message key="card.cipErrors.status"/>'
      },
      {
        "mData": "jsonRequest",
        "sTitle": '<fmt:message key="card.cipErrors.jsonRequest"/>'
      },
      {
        "mData": "jsonResponse",
        "sTitle": '<fmt:message key="card.cipErrors.jsonResponse"/>'
      }

    ],
    editLinks: [{ //Edit
      selector: ".cipSummary",
      callback: function(target, data) {
        //  debugger;
        $ {
          prefix
        }
        ActionFormHandler.open(data);
      },
      disabled: $ {
        actionBean.restricted['RESTRICT_EDIT']
      }

    }],
    postInitCallback: function() {
      console.log(this.container.find(".appendImage"));
    },
    actionButtons: {
      exportText: '<fmt:message key="export.csv"/>'
    }


  }
  $(document).ready(function(data) {
    $('#cipTable').DataTable({
      "order": [
        [3, "desc"]
      ],
      "columnDefs": [{
          targets: 0,
          data: "createdDate"
        },
        {
          targets: 1,
          data: "status"
        },
        {
          targets: 2,
          data: "jsonRequest"
        },
        {
          targets: 3,
          data: "jsonResponse"
        }
      ]
    })
  });