API AJAX Error

Tagged:

Currently contains 2 posts

Avatar

March 09, 2017 06:59

Emma Carr

I keep getting “No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘null’ is therefore not allowed access.” when I try the call below.

<script> $.ajax({ url: "https://api.weatherunlocked.com/api/current/51.5,-0.1?app_id={app_id}&app_key={app_key}", type: "GET", dataType: "json", success: function () { alert("suc"); }, error: function (error) { alert("fail"); } }); </script>

Avatar

March 09, 2017 11:11

Marco

Hi Emma,

The requested URL looks correct, can you run that URL directly in a browser and see if you get an error message?

Cheers,

Marco

Reply to thread
  1. If you're human, leave this field empty.