I'm having some issues when trying to call in content from a subdomain using .load
After googling and reading and not really understanding I don't think this can be done?
Here's the error I'm receiving:
XMLHttpRequest cannot load http://content.domain.co.uk/test.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.domain.co.uk' is therefore not allowed access.
I've read somewhere that I can add the document.domain into my external file - This also doesn't work - Am I doing this right?! I'm not sure.
<script type="text/javascript">
document.domain = 'domain.co.uk';
</script>
Here is my code:
$(function() {
$('#activate').click( function() {
$('#activate').hide();
$('#loadingImg').show();
$('#testContainer').load('http://content.domain.co.uk/test.html #main', function() {
$('#loadingImg').hide();
});
});
});
I've read that what I'm trying to do could probably be achieved using JSON - However, I'm really not sure what or how to do this. Any help would be really appreciated.
Thanks!