搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

I'm getting CORS Same origin error from https://nationalmap.gov elevation point service. Cross-Origin Request Blocked: The Same Origin Policy disallows reading

  • 2 回覆
  • 1 有這個問題
  • 41 次檢視
  • 最近回覆由 FredMcD

more options

Works fine on Chrome and IE. I have some code that makes a request to nationalmap.gov . It's a service, so it should be allowed from their server.

$http({

           url: "https://nationalmap.gov/epqs/pqs.php?x="+coord[0]+"&y="+coord[1]+"?units=Feet&output=json",
           method: "GET",
           crossOrigin:true
   	}).then(successCallback, errorCallback);

URL: https://nationalmap.gov/epqs/pqs.php?x=-77.05355372624011&y=38.8977679652815?units=Feet&output=json

所有回覆 (2)

more options

edit. It's crossOrigin:'anonymous'

more options

選擇的解決方法