Announcements
Hello knowledgeable peeps!
Today i'm facing a couple of issues with D365 Portals... i have to display on a portals Page the weather from a open api... easy thing... until i'm getting errors by CORS and CROSS-DOMAIN stuffs...
i've tried adding HTTP/"HEADERS" to Portals Settings... it fixes a couple of things, but still not able to consume the data to display the fakin weather report...
Here the code i'm using to get the data, then i use JS to set it on divs in the requested page:
$.ajax({ type: 'GET', url: 'https://forecast7.com/es/41d392d17/barcelona/?format=json', crossDomain: true, dataType: 'jsonp', success: function(data){ console.log(data); } });
here the config i made in Portals Settings
Here the error i'm getting:
"Script from forecast7.com/.../ was blocked due to mime type mismatch"
If i try to set the <script type="application/json"> it does nothing, and if i use it as "type=text/javascript" it does nothing neither.
What could i be missing? or what im doing wrong?
Appreciate any guide or friendly hand,
Thanks in advance!
hey, try to set the content type in your ajax call along with the datatype as well. Check https://stackoverflow.com/questions/18701282/what-is-content-type-and-datatype-in-an-ajax-request for reference.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,802 Super User 2024 Season 2
Martin Dráb 229,133 Most Valuable Professional
nmaenpaa 101,154