Issues with Dynatree loading on Internet Explorer 9

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.

Answer №1

Well...., the issue seems to be with this particular line:

console.log(obj);

Once I commented out that line, everything started functioning properly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unwrapping super type property in Jackson's polymorphic serialization: the ultimate guide

Here's the scenario I'm dealing with: @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT) @JsonSubTypes({ @JsonSubTypes.Type(value = FlyingCar.class, name = "flying_car"), @JsonSubTypes.Ty ...

Tips on efficiently storing JSON objects into an array using PHP

Below is my PHP code used to retrieve data in JSON format: if($status==1) { $post_id=$json_object['post_id']; $get_postid=mysqli_query($con,"select * from User_Post where post_id='$post_id'"); if(mysqli_nu ...

Steering clear of using relative paths for requiring modules in Node.js

When it comes to importing dependencies, I like to avoid using excessive relative filesystem navigation such as ../../../foo/bar. In my experience with front-end development, I have found that using RequireJS allows me to set a default base path for "abso ...

Manipulating nested JSON objects with AngularJS by adding and pushing the data

I am looking at a JSON object structured like this : { "Name": "Shivansh", "RollNo": "1", "Stream": "CSE", "OverallScore": "76", "Semester": [ { "SemesterName": "FY-2012 - 1", "TotalScore": "78.00", ...

What is the best way to reset an event back to its original state once it has been clicked on again

As a newcomer to web development, I'm currently working on creating my own portfolio website. One of the features I am trying to implement is triangle bullet points that can change direction when clicked - kind of like an arrow. My idea is for them to ...

Set the class of an element dynamically using ng-class and detect changes with ng-change

I want the input field to initially have the class .form-control-error. When the user clicks on the field and starts typing, I would like it to change to .form-control-success. I attempted the following code but couldn't get it to update. The ng-chan ...

Exploring JSON data with Angular

I am struggling with searching JSON data using Angular. After following various tutorials online, I am now facing an issue where the JavaScript debugger in Chrome shows that the script is running but nothing is being displayed on the page. As a beginner, ...

Because of the CSS tree structure, it is not possible to add or remove classes. This restriction applies to all actions done in jQuery, including click

I want to create a hover effect where the CSS changes when hovering over an item, then reverts back to normal when no longer hovered. Additionally, I would like the CSS to change when the item is selected, and return to normal when another item in the same ...

What is the best way to detect and handle the destroy event in Kendo UI grids when a click event

How can I trigger a function when the delete button in a grid is clicked using JavaScript? ...

Store the output of the function in a variable

Here is a script that was provided to me: <div id="container1"> <script> var script = document.createElement("script"); script.type = "text/javascript"; script.text = 'document.write(xmlDoc.getElementsByTagName("INFO") ...

Using plain JavaScript, adding an element to an array by pushing the value of a string variable in an index position rather than pushing the

I have the following JavaScript code snippet: let array = []; const datas = [ 'name1', 'name2', 'name3', ]; async function getData() { datas.forEach((data) => { let myData = data.name; if(!array.include ...

What are some ways to adjust the size of the option field in a select menu?

In my ionic popup, I have a HTML property called select with nested options. Below is the code snippet along with the applied CSS. My query is how can I set the white space to occupy the entire area of the select? https://i.stack.imgur.com/iPqAa.png http ...

What is the best way to insert an <image> tag into the SVG DOM?

Currently, I am facing an issue with adding a background image to the generated SVG DOM in my web page. The user interacts by drawing an SVG doodle on top of a jpg image using Raphael. After the user is done with their drawing, I want to enable them to sa ...

Can we extract unique values from a JSONObject in Java?

I have a JSON file containing 500,000 objects in the following format: "WORKORDER": [ { "Attributes": { "SITEID": { "content": "BEDFORD" }, " ...

What is the most efficient way to integrate JSON Data into a Line of Business Web Application?

Typically, I've been using JSON with jQuery to return HTML strings. However, I'm interested in transitioning to JavaScript objects in my code. What's the easiest way for me to begin using JSON objects on my webpage? Below is a sample Ajax ...

Exclude chosen API responses prior to presenting them in the Table View

Dealing with data retrieved from an API through RestKit. My aim is to retrieve a list of businesses from the API, and I have successfully achieved that. However, on my end, I need to filter out any business classified as "McDonalds" before presenting the ...

What are the risks of employing conditional rendering in react-router-dom for authentication purposes?

In the following code snippet: If the authentication data sent from the client matches in the backend, a response with the user ID is sent. If setIsAuth sets to true, the Layout Component will display the first case within the Switch component, allowin ...

Is there a way to incorporate a fade-in effect when I trigger the expand function in this script?

I recently came across a jQuery plugin for expanding and collapsing content. I am interested in adding a fade-in effect to this plugin specifically when the EXPAND button is clicked. How can I accomplish this? $(document).ready(function () { var maxlines ...

Prevent form submission using jQuery based on ajax response, or allow it to submit otherwise

After setting up some jQuery code to handle form submission, the functionality is working well when certain conditions are met. However, I am facing a challenge in allowing the form to be submitted if the response received does not match specific criteria. ...

Daily loop countdown timer

Looking to implement a daily countdown timer that ends at 10am, I have the following code set up: setInterval(function time(){ var d = new Date(); var hours = 09 - d.getHours(); var min = 60 - d.getMinutes(); if((min + '').length == 1){ ...