I am trying to load html screens on a page. I send the http request, and then when I receive the response, I set my div.innerHTML to display the contents. This works, however I keep receiving this error in my Javascript Console that says junk after document element.
function loadScreen(screen) {
http_request.onreadystatechange = function() { screenIsLoaded(http_request); };
http_request.open(‘GET’, screen, true);
http_request.send(null);
}
function screenIsLoaded(http_request) {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var text = http_request.responseText;
var mainPanel = browserObject(‘mainPanel’);
mainPanel.innerHTML = text;
} else {
alert(‘There was a problem with the request.’);
}
}
}
If anyone can see what might be happening, I would greatly appreciate it. Thank you!
Jason