Processing
 

Internet Explorer Incompatibility v9 & v8 [object Object] ~ additional

25/08/2016 10:03#1

M70-536

Member

Joined at: 4 months ago

Post: 2

Thank: 0

Thanked: 0

I am developing a Dashboard project, a component of which shows a summary table within a "minified" window on the dashboard, with the query parameters a user input to produce a particular report.

The code renders perfectly in Chrome, Firefox, Internet Explorer 11 and 10, Microsoft Edge and here is an example of what is correctly rendered.

Internet Explorer Incompatibility v9 & v8 [object Object] ~ additional

However, some of my clients are still using Internet Explorer 9 and 8 and I must support them with code that is compatible and it's with these versions that I have problems as the following example shows.

Internet Explorer Incompatibility v9 & v8 [object Object] ~ additional

So, as you can see, for each user input object, for some reason [object Object] is displayed above in the summary table.

The user input variables are stored as a hidden tag, and example below

Internet Explorer Incompatibility v9 & v8 [object Object] ~ additional

The process is as follows

1) I populate the table by passing the stored input variables to the server and return a JSON object with the results

 $.getJSON('/analyticsdashboard/SysoutSearch/GetSysout?' + $('#hdnParameters').val().slice($('#hdnParameters').val().indexOf('?') + 1)).done(function (result) {             var tbl = $("#tbl");             var tbody = $('#tbl>tbody'); 

2) I then and 'strip' out the variables into specific objects

var jobName = getURLParameterForHtml('jobName', $('#hdnParameters').val());             var startDate = getURLParameterForHtml('startDate', $('#hdnParameters').val());             var startTime = getURLParameterForHtml('startTime', $('#hdnParameters').val());             var endDate = getURLParameterForHtml('endDate', $('#hdnParameters').val());             var endTime = getURLParameterForHtml('endTime', $('#hdnParameters').val());             var lastxDays = getURLParameterForHtml('lastxDays', $('#hdnParameters').val());             var tableName = getURLParameterForHtml('tableName', $('#hdnParameters').val());             var groupName = getURLParameterForHtml('groupName', $('#hdnParameters').val());             var applicationName = getURLParameterForHtml('applicationName', $('#hdnParameters').val());             var memberName = getURLParameterForHtml('memberName', $('#hdnParameters').val());             var owner = getURLParameterForHtml('owner', $('#hdnParameters').val());             var nodeId = getURLParameterForHtml('nodeId', $('#hdnParameters').val());             var endStatus = getURLParameterForHtml('endStatus', $('#hdnParameters').val());             var serverName = getURLParameterForHtml('serverName', $('#hdnParameters').val());             var orderId = getURLParameterForHtml('orderId', $('#hdnParameters').val()); 

The getUrlParameter function below

var getUrlParameter = function (sParam, url) { //debugger; //window.location.search var sPageURL = decodeURIComponent(url.substring(1)),     sURLVariables = sPageURL.split('&'),     sParameterName,     i;  for (i = 0; i < sURLVariables.length; i++) {     sParameterName = sURLVariables[i].split('=');      if (sParameterName[0] === sParam) {         return sParameterName[1] === undefined ? true : sParameterName[1];     } } 

};

3) I then test for objects that contain data i.e. are not empty and append them as a row into the summary table body, an example below

 if (jobName[1]) {                         var newRow = "<tr><td></td><td>" + "Job Name" + "</td>" + "<td>" + jobName[1] + "<td></td></tr>" + tbody.append(newRow);                     } 

I've tried researching this here at SO, for example Internet Explorer Incompatibility - page just shows "[object Object]" WTH?

But have been unable to find a solution or fully understand the problem.

I'd like to know

1) Why does this problem occur in IE9 and IE8 and not Chrome, Firefox, IE 10 and IE11, Microsoft Edge?

2) What can I do to resolve this?

25/08/2016 13:14Top#2

M70-536

Member

Joined at: 4 months ago

Post: 2

Thank: 0

Thanked: 0

This problem was caused by my miss coding of the HTML to append a new row to the summary table.

Previously I appended each new row, for example, as

if (jobName[1]) {                   var newRow = "<tr><td></td><td>" + "Job Name" + "</td><td>" + jobName[1] + "</td></tr>" + tbody.append(newRow);                 }   

It was this miss coding that caused the problems in IE8 and IE9.

I've changed the code by splitting the new row and the tbody.append(newRow) into two separate statements, an example follows

if (jobName[1]) {                 var newRow = "<tr>" + "<td></td>" + "<td>" + "Job Name" + "</td><td>" + jobName[1] + "</td>" + "</tr>";                 tbody.append(newRow);             } 

and my "minified" window now renders correctly in IE8 > IE11, Microsoft Edge, Chrome and Firefox.

Similar articles

IE9 dosen't support my Button Tag

4 months ago - Reply: 0 - Views: 14

SSRS 2016 Web protal in IE8

4 months ago - Reply: 0 - Views: 13

how to handle @keyframes not supported by ie9?

4 months ago - Reply: 0 - Views: 5

Detect Windows XP in Firefox with JS

4 months ago - Reply: 1 - Views: 47

IE8 Not showing divs with floats

4 months ago - Reply: 2 - Views: 130

Including ECMA 5 script in IE8

5 months ago - Reply: 1 - Views: 98

XDomainRequest does not work in ie8 & ie9

5 months ago - Reply: 0 - Views: 10

How to minify angular.js?

5 months ago - Reply: 1 - Views: 30

VBA and IE8 - scrape text buried in table

5 months ago - Reply: 1 - Views: 37

Detect http satus IE10

5 months ago - Reply: 0 - Views: 6

how to compress angular.js?

5 months ago - Reply: 0 - Views: 3

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re