Javascript mac机器编号';访问控制允许原点';请求的资源上存在标头

Javascript mac机器编号';访问控制允许原点';请求的资源上存在标头,javascript,jquery,html,css,angularjs,Javascript,Jquery,Html,Css,Angularjs,angular应用程序在windows计算机上运行良好,但同一应用程序在Mac上不工作。我在Mac中得到以下错误。你能告诉我为什么吗 XMLHttpRequest cannot load http://sports.com/. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested res

angular应用程序在windows计算机上运行良好,但同一应用程序在Mac上不工作。我在Mac中得到以下错误。你能告诉我为什么吗

XMLHttpRequest cannot load http://sports.com/. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.


       if(window.location.hostname == "localhost"){
            this.sportsURL = 'http://sports.com/';
        }else{
            this.sportsURL = window.location.protocol+'//'+ window.location.hostname+ "/";
        }

没有更多的细节,没有人知道发生了什么。你能发布调用请求的代码吗?你用的是什么浏览器?你发布的错误消息片段中的URL正确吗?@ChristopherRonning嘿,你能告诉我我需要发布哪个文件吗…因为我看到了这么多文件…这是一个大应用程序正在向sports.com发出请求lol@texirv什么是WilomGfxsaid@ChristopherRonning你好,更新了代码