/    Sign up×
Community /Pin to ProfileBookmark

Problem in executing the code with IE browser

My need is to create a table dynamically and append it with corresponding values from the response XML. My problem is my code is working properly in FireFox browser, where in IE it shows an error – “document.getElementById(…).rows.1.cells’ is null or not an object”.

My function code
var tableEle = document.createElement(‘TABLE’);
var trow = document.createElement(‘TR’);
tableEle.appendChild(trow);
var tcel = document.createElement(‘TD’);
var input = document.createElement(‘input’);
input.setAttribute(“type”, “text”);
tcel.appendChild(input);
trow.appendChild(tcel);
pContainer.appendChild(tableEle);

document.getElementById(tableName).rows[1].cells[1].innerHTML = ~xml value~;

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@mrhooApr 13.2013 — excuse it- I neglected to see your assigning via innerHTML, which doesn't work for table cells in older IE's.
×

Success!

Help @ShriKrish spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...