Having integrated a dynatree into a web application, the dynatree is generated from the server using a JSON object. The dynatree functions perfectly on updated versions of Firefox, Safari, Chrome, and Opera, but I encounter an issue with Internet Explorer 9. I am only able to load the tree after refreshing the page or starting debug mode. Despite reviewing the console and script, I cannot identify any errors. Any suggestions? Has anyone else encountered a similar problem?
function makeRequest(url, callback){
var request;
if(window.XMLHttpRequest){
request = new XMLHttpRequest();
}else{
request = new ActiveXObject("Microsoft.XMLHTTP");
}
request.onreadystatechange = function(){
if (request.readyState == 4 && request.status == 200){
callback(request);
}
}
request.open("GET", url, true);
request.send();
}
Implementation of the function:
makeRequest('/WebServices/Areas.jsp', function(data){
var jsonData = JSON.parse(data.responseText);
var treeData = jsonData;
eval('var obj='+treeData);
console.log(obj);
$(function(){
$("#tree3").dynatree({
checkbox: true,
selectMode: 3,
children: obj,
onSelect: function(select, node) {
if(!select){
if(node.data.key=="areas"){
enableSelection=false;
loadMapRegion(map, enableSelection);
}
if(node.data.key=="city"){
enableSelection=false;
loadCityMap(map, enableSelection);
}
}
if(select){
if(node.data.key=="areas"){
enableSelection=true;
loadMapRegion(map, enableSelection);
}
if(node.data.key=="city"){
enableSelection=true;
loadCityMap(map, enableSelection);
}
}
},
onDblClick: function(node, event){
node.toggleSelect();
},
onKeydown: function(node, event) {
if( event.which == 32 ) {
node.toggleSelect();
return false;
}
}
});
Appreciate your assistance.