Getting error in AJAX response on Safari browser only

点点圈 提交于 2019-12-24 13:56:00

问题


I'm facing very strange issue. I'm using below code to get value from an API:

    var getId = function () {
    var url: "Proxy:url=https_URL"
     var result;
        $.ajax({
            type: 'GET',
            url: url,
            dataType: 'json',
            contentType: "application/json",
            success: function (res) {
                objLen = res.length;
                var arrElems = [];
                for (i = 0; i < objLen; i++) {

                    arrElems[i] = res[i].ids;

                }
                result = arrElems;

            },
            error: function (e) {
                result = e;
            }
        })
       return result;
    }

Its responsing as success but when I run this code on Safari its giving an error. Can anyone please help me to find what is the issue and to solve it?

来源:https://stackoverflow.com/questions/14996110/getting-error-in-ajax-response-on-safari-browser-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!