###前提・実現したいこと
Angular2にて、webAPIよりjsonを取得したいと考えております。
しかし、下記のようなエラーが発生しており、解決の糸口がつかめません。
なにとぞご教授願えればと考えております。
###発生している問題・エラーメッセージ
this.jsonp.getで取得した場合、
Refused to execute script from 'URL' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
this.http.getで取得した場合、
XMLHttpRequest cannot load URL. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
###該当のソースコード
Angular2
1this.jsonp.get(this.Url)
or
Angular2
1this.http.get(this.Url)
###試したこと
当初はhttp.getで取得しようと試みていたが、クロスドメイン問題に直面したため、jsonp.getを用いた。
しかし、そちらは上記のようにMIMEに問題が発生している。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/14 06:21