クライアント側(JS)で自作apiを叩いています。
apiを叩くと、
XMLHttpRequest cannot load http://api-example.com/timelines/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
というようなエラーが出ており困っています。
apiはPHPで作られており
。
http://crunchtimer.jp/blog/technology/jquery/330/
を参考に以下のheaderを記述しました。
header("Access-Control-Allow-Origin: *");
が同じエラーがでます。
api-example.com(仮名)は別サーバにあり、
他のapiを叩いているプログラムがローカルだからでしょうか?
何か原因分かる方いましたらご教授お願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。