SCRIPT5: Access is denied in IE9 on xmlhttprequest

后端 未结 11 1950
太阳男子
太阳男子 2020-11-28 07:42
var xhttp=new XMLHttpRequest();
xhttp.open(\'GET\', \'foo.xml\', false);

F12 pops back: SCRIPT5: Access is denied. on Line 95, which is

11条回答
  •  不知归路
    2020-11-28 08:28

      $.ajax({
            url: '//freegeoip.net/json/',
            type: 'POST',
            dataType: 'jsonp',
            success: function(location) {
                alert(location.ip);
            }
        });
    

    This code will work https sites too

提交回复
热议问题