我遇到了这个代码的问题,我似乎无法让它工作.我收到此调用的典型错误是"无法加载资源:服务器响应状态为401(未授权)".
$('#btnZendesk').click(function () {
      $.ajax({
          url: "https://flatlandsoftware.zendesk.com/api/v2/topics/22505987.json",
          type: 'GET',
          crossDomain: true,
          xhrFields: {
              withCredentials: true
          },
          cache: false,
          dataType: 'jsonp',
          processData: false,
          data: 'get=login',
          timeout: 2000,
          username: "test@test.com",
          password: "test",
          success: function (data, textStatus, response) {
              alert("success");
          },
          error: function (data, textStatus, response) {
              alert(data);
          }
      });
Run Code Online (Sandbox Code Playgroud)