0

I have tried to connect to a HTML file in the same directory using href, but it gives me an error loading page.

It gives the following error:

XMLHttpRequest cannot load file:///C:/Users/Nadeesha/Desktop/Collect/FounderR.html. Received an invalid response. Origin 'null' is therefore not allowed access.

What can I do to solve this?

<a data-theme="d" data-corners="false" data-role="button" href="FounderR.html">
       <img src="images/icons/round/64x64/entr.gif" alt="entr" style="display: block; margin: 0 auto">
        Founder
</a>
AstroCB
  • 12,337
  • 20
  • 57
  • 73

1 Answers1

1

If you are using chrome, and i assume you are, You will face CORS problems when working o localhost.

Ill recommend you to read this:

https://developers.google.com/storage/docs/cross-origin?hl=es

  • Nadeesha's files are in the same directory as the resource that's requesting them. This wouldn't violate the same-origin policy. – Jerreck Sep 12 '14 at 20:38
  • Yes it would. See the url he is using. Please read the document i´ve left on the comment. – Santiago Nicolas Roca Sep 12 '14 at 20:44
  • Ah, made sense after I read [this](http://stackoverflow.com/questions/4208530/xmlhttprequest-origin-null-is-not-allowed-access-control-allow-origin-for-file). My bad. – Jerreck Sep 12 '14 at 20:55