I've read about origin policy etc and as I understand it you should put origin policiy domain on the client and on the server.
Ok lets say I have this code on example.com
and I want to fetch info from the page doyouknoweverything.doyouknoweverything.com/recordOfMyLife
with jQuery/ajax
<div id="sk">Loading...</div>
<script>
document.domain = "{example.com}";
$( "#sk" ).load( "http://whatever.doyouknoweverything.com/recordOfMyLife" );
</script>
If I understand this correctly I can do like this in the php-file whatever.doyouknoweverything.com/recordOfMyLife
:
header("Access-Control-Allow-Origin: *");
Is this correct?
Why do I get error domain is not a suffix of localhost? I guess I don't understand and it is probably something very easy for you guys who have done this before...