jQuery.ajax({
type:"GET",
url:this.file,
dataType:"xml",
success:function(xml){alert(xml);}
});
jQuery.get("test.xml",function(xml){alert(xml);});
instanceProto.loadFile = function(file)
{
var request = null;
if (window.XMLHttpRequest)
{
request = new XMLHttpRequest;
}
else
{
alert("XMLHttpRequest is not supported by your browser.");
};
if(!(request === null))
{
request.open("GET", file, true);
request.onreadystatechange = function()
{
if (request.readyState == 4 /* complete */) {
if (request.status == 200 || request.status == 304) {
alert('Transfer complete. XML data updated.');
this.data = request.responseText;
this.ready = true;
}
else {
alert('An error occurred. Old XML data kept.');
this.ready = true;
};
};
request.send();
this.ready = false;
};
}
}
But nothing works. No data is loaded, hell, AJAX doesn't even complete the task. I don't even get the error popups when AJAX would fail to load a file.
I've tried all these locally as well as exported to dropbox.
So how the heck do you load a local (to the index.html) file? Because a lot hinges on this functionality.