I have been working on a website that loads HTML content from a template page and then pulls in data from an XML file. This process is initiated in the document.ready function as shown below:
$.ajax({
type : "GET",
url : "template.html",
dataType : "html",
success : function(html) {
var ndoc = document.createElement('html');
ndoc.innerHTML = html;
page = $('body', ndoc);
$('body').html(page.html());
$.ajax({
type : "GET",
url : "XML/content.xml",
dataType : "xml",
success : function(xml) {
page = $(xml).find('chisiamo').find('dialogue')[0];
setupPage(page);
}
});
}
});
While this setup works smoothly in Firefox and Safari, I encountered a problem in Chrome where I received an 'Origin null is not allowed by Access-Control-Allow-Origin' error message while trying to load template.html. Can anyone provide guidance on how to resolve this issue? Thank you.