API:为什么我得到的输出是[objet objet]而不是令牌?

时间:2018-11-14 23:16:16

标签: javascript jquery

我是jQuery和API的新手。我想将$.ajax响应存储到一个变量中,但是我得到的输出为[object object]而不是令牌字符串。 我的代码如下:

var result=$.ajax({  
             "async": true,
              "crossDomain": true,
              "url": "https://.........../api/v1/sdk_initialize", 
              "method": "GET",
              "headers": {
                 "Content-Type": "application/json",
                 "cache-control": "no-cache",
                 "Authorization": "Basic .........=",
              },
              success: function(response) {
                  return response;
              }
          });

alert(result);

0 个答案:

没有答案