0

I just tried to load data from www.somedomain.com's #SomeText Tag in #Data Tag with jQuery Ajax I used :

<script>
    $(function () {
        $("#Data").load('http://www.somedomain.com/index.html#SomeText');
    });
</script>

but webpage text doesn't load and in Google Chrome's JavaScript console I got this error:

XMLHttpRequest cannot load http://www.somedomain.com/index.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:9154' is therefore not allowed access.
  • 1
    you tried cross domain scripting ... read this https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS and google for "chrome Access-Control-Allow-Origin" – daremachine Jun 04 '15 at 14:20
  • This might be due to cross domain access you may user cURL for this purpose. – PHP Worm... Jun 04 '15 at 14:20
  • If you run your html page on a web server it should work. If you are just running it locally then you will run into the the CORS issue. – khollenbeck Jun 04 '15 at 14:27
  • I running in IIS Express –  Jun 04 '15 at 14:35

0 Answers0