Hello everybody,
I’m trying to embed a tree inside a div of a page, by using XMLHttpRequest, but it is not shown inside the page.
If I load the tree outside the main page, it works.
Here is the code of the main page (the div name is “tree”, the tree page name is “tree.asp”:
function visualizza_tree()
{
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
tree= new XMLHttpRequest();
tree.onreadystatechange = carica_tree;
tree.open(“GET”, “tree.asp”, true);
tree.send();
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
tree= new ActiveXObject(“Microsoft.XMLHTTP”);
if (tree) {
tree.onreadystatechange = carica_tree;
tree.open(“GET”, “tree.asp”, true);
tree.send();
}
}
}
function carica_tree() {
var visTree;
if (tree.readyState == 4) {
visTree=tree.responseText;
document.getElementById(‘tree’).innerHTML = visTree;
}
}
Any help?
thank you
Antonio