0

I am trying to load the html from a url to a div container on my webpage but I am getting this error "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."

My website is built using only html and jquery/javascript.

$('.myContainer').load('http://s3-ap-southeast-1.amazonaws.com/myfolder/mypage.html')

Please let me know how can I resolve this error?

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
  • You cannot make a "cross-domain" call to load a URL. There are solutions described here eg. http://stackoverflow.com/questions/15005500/loading-cross-domain-html-page-with-ajax – Bajal Dec 17 '15 at 17:27

1 Answers1

2

The page you are trying to load has this header in its response.

X-Frame-Options:SAMEORIGIN which means, other domains except for its own, can not load this URL.

X-Frame-Options is used to restrict cross-domain resource accessing.

Bee
  • 12,251
  • 11
  • 46
  • 73