Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implications of JavaScript same origin policy on dynamic image loading

If JavaScript has a same origin policy, does that mean that I can't dynamically load images from a different domain?

like image 296
Yarin Avatar asked Dec 01 '25 21:12

Yarin


1 Answers

No, the same origin policy does not apply to <img> tags.

There are other notable exceptions, some of which are described in that Wikipedia article. They include:

  • Style-sheets
  • Scripts (this is how JSONP works)
  • Form submissions
like image 131
Matthew Flaschen Avatar answered Dec 04 '25 10:12

Matthew Flaschen