首页 > 解决方案 > Ajax 调用返回未定义对象

问题描述

我正在进行 ajax 调用,但是在调试时我得到了未定义的对象:

    var model;
  $.ajax({
        type: "GET",contentType: "application/json; charset=utf-8",
        datatype: "json", async: false,
        url: "http://Test/ws/api/v1/account?id=48099",
        headers: {'XIDENTITY':'{"guid":null,"login":"Test01","password":null}'},
        error: function (xhr, textStatus, errorThrown) {alert(textStatus + " " + errorThrown);},
        success: function (data, textStatus, xhr) 
        {
        var response = data.d.results;
        var Record = JSON.parse(JSON.stringify(response[0]));
        model=Record.model;
        
        }
    });

返回模型;

标签: ajaxweb-servicescrmmicrosoft-dynamics

解决方案


推荐阅读