pschfr / start

Personal new tab page with bookmarks, weather, quote, and image background.

Home Page:https://pschfr.github.io/start/dist/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No "Access-Control-Allow-Origin" problem with DarkSky, GMail

lawrenceadams opened this issue · comments

Hey,

I'm not sure if its just me this is happening to ~ but do you know how to get around the "No 'Access-Control-Allow-Origin' header is present on the requested resource" errors that are thrown by both GMail and the DarkSky functions?

Cheers,
L

This is the way I got around the problem (jQuery with JSONP AJAX request): https://github.com/lozinge/start/blob/gh-pages/src/script.js#L187-L194

This is kinda out of scope, as this a browser-introduced limitation. What you can do, is route the requests through a PHP proxy such as cowboy/php-simple-proxy.