LoginSignup
7
5

More than 5 years have passed since last update.

cross-originで画像が読み込めない時

Last updated at Posted at 2016-02-20

chromeでThree.jsを書いていると、こんなエラーが出た。。
異なるドメインに存在するリソースは利用できないということ。

error
DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at file:///Users/...

そんな時は、phpでサーバーを立てる。

bash
php -S localhost:9000(任意の数字)

localhost:9000にアクセスすると表示される。
もしくはfirefoxならデフォルトで表示される。

ウェブブラウザの設定変更という方法もある。
http://qiita.com/growsic/items/a919a7e2a665557d9cf4

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5