function getSSOUrl (urlvalue) { var URLs; $ .ajax ({ type: "the GET" , URL: "../../GeoManage/TBL__PROJECTINFO/GetUrl?urlvalue=" + urlvalue, Success: function (Data) { URLs = Data; } }) return urls; } write success urls inside has a value, but following return urls; not determined value, the following modifications added, the async: to false , // synchronization request can be a function getSSOUrl (urlvalue) { var urls; $ .ajax ({ of the type: "GET" , url:"../../GeoManage/TBL__PROJECTINFO/GetUrl?urlvalue=" + urlvalue, async: false, //同步请求 success: function (data) { urls = data; } }) return urls; }