Have not done this before. so most likely this is totally wrong. I was having cross referencing issue so I put a simple text file on a server. this is in my .js
var xhttp;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET", "http://agileart.us/aa-tempbuild/textContent.txt", true);
xhttp.send();
$("#subSect1").load("http://agileart.us/aa-tempbuild/textContent.txt");
You need to get your web server (apache/IIS/etc) configured to send the Access-Control-Allow-Origin header… just putting that at the top of your file won’t work.