Hey guys,
i'm fairly new to ajax, and today discovered that javascript files won't fire within an ajax loader.
my problem: i've built a web application using a mixture of javascript, ajax, and html. however this is designed to go on a page that already takes a little time to load.
So i thought' id do a:
<body onload="ajaxLoader('file.php','holder')" >
javascript:
function ajaxLoader(url,id) {
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
x.onreadystatechange = function() {
if (x.readyState == 4 && x.status == 200) {
el = document.getElementById(id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}
this works fine it loads the php file but doesnt import the javascript files.
i've got 3 javascript files that i need to use within the 'mini app' how do i load these javascript files within the application?
any help greatly recieved
Andy.