简体   繁体   English

Dynatree IE9问题加载

[英]Dynatree IE9 problems loading

I´ve implemented a dynatree on a web application, dynatree is generated from server with a JSON object. 我已经在Web应用程序上实现了dynatree,dynatree是从服务器使用JSON对象生成的。 Dynatree works perfectly on Firefox, Safari, Chrome and Opera (last versions), but when I open on IE9, I just capable of loading the tree after refresh the page, or start the debug mode. Dynatree在Firefox,Safari,Chrome和Opera(最新版本)上都可以完美运行,但是当我在IE9上打开时,只要刷新页面或启动调试模式,我就能够加载树。 I can´t find any mistake on console, script.... Any suggestion? 我在控制台,脚本上找不到任何错误。...有什么建议吗? someone with the same problem? 有同样问题的人吗? Code: 码:

function hacerPeticion(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();
            }

Using the function: 使用功能:

hacerPeticion('/ServiciosWeb/Zonas.jsp', function(data){
                var data = JSON.parse(data.responseText);
                var arbol = data;
                eval('var obj='+arbol);
                console.log(obj);
           $(function(){
                    $("#tree3").dynatree({
                        checkbox: true,
                        selectMode: 3,
                        children: obj,
                        onSelect: function(select, node) {

                            if(!select){
                                if(node.data.key=="zonas"){
                                    control=false;
                                    cargaMapaCYL(map, control);
                                }
                                if(node.data.key=="ast"){
                                    control=false;
                                    cargaMapaAst(map, control);
                                }
                            /*Nodos seleccionados*/
                            if(select){
                                if(node.data.key=="zonas"){
                                    control=true;
                                    cargaMapaCYL(map, control);
                                }
                                if(node.data.key=="ast"){
                                    control=true;
                                    cargaMapaAst(map, control);
                                }
                            }

                        onDblClick: function(node, event){
                            node.toggleSelect();
                        },
                        onKeydown: function(node, event) {
                            if( event.which == 32 ) {
                                node.toggleSelect();
                                return false;
                            }
                        }
                    });

Thanks in advance. 提前致谢。

So....., the problem is in this line: 所以..,问题在这一行:

console.log(obj);

When I have retired this line everything works fine. 当我退役这条线时,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM