I'm currently using this code:
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<div class="div"></div>
<script>
var timer = 10;
var source = 'file.php';
$(document).ready(function() {
refresh();
setInterval(function() { refresh() }, timer * 1000);
});
function refresh() {
$('.div').load(source);
}
</script>
But, if I put a link to the file.php file, say http://example.com/file.php, it doesn't load anything.
What I would like to do is to be able to load remote files.
How can I go about doing this? Or is this disabled for security reasons?
My console shoots the following error:
XMLHttpRequest cannot load SOURCE. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'URL' is therefore not allowed access.
SOURCE is the place I was trying to load from, and URL is the place I was trying to load the source.