0

So right now I have a html file which I need locally stored, when I open this webpage I need it to download some content from a webserver.

I've tried using Jquery's AJAX but that doesnt let me use cross domain, so I am stuck, here is what I have tried to get to work

<script>
    $(document).ready(function() {
        var url = 'example.com/function.php?ID=' + id;
        $( "#result" ).load( url);
    });
</script>

Obviously Im aware the above code I made does not work as it has something to do with it being cross domain.

StudioTime
  • 22,603
  • 38
  • 120
  • 207
DanielJ
  • 729
  • 2
  • 7
  • 26

1 Answers1

0

You can use JSONp method, this method is preferable. Here is how: Link

Or you can allow access on server side by using Access-Control-Allow-Origin: * in php headers. You write your own domain instead of using *

Community
  • 1
  • 1
David Arutiunian
  • 193
  • 1
  • 3
  • 11