I am a beginner at JavaScript so I'm sorry if this is a noob question. I'm trying to use XmlHttpRequest to call an HTML file (example.html) with a JavaScript (such as an RSS feed script) in the called HTML file. Any scripts in the called HTML file (example.html) won't load. It will load any plain text or hyperlinks in the called HTML file though. I've even tried changing the called file. For example switch "example.html" with "rssfeeder.js" to see if it'd load the JavaScript on demand, but that still didn't work. Again, I'm very new at JavaScript, so please be detailed in your answers. Thanks! Here is the script I'm using:
var receiveReq = getXmlHttpRequestObject();
function Example() {
if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
receiveReq.open("GET", 'example.html', true);
receiveReq.onreadystatechange = handleExample;
receiveReq.send(null);
}
}
function handleExample() {
if (receiveReq.readyState == 4) {
document.getElementById('span_result').innerHTML = receiveReq.responseText;
}
}