OK, so it is kind of easy to dynamically create content using document.createElement() and appendChild() methods in Firefox for an xhtml document.
The thing is, IE does not act on them. I can only set innerHTML to something, IE seems to ignore appendChild(). This makes me to generate actual HTML from js.
This works in FF, not in IE:
So the questions areCode:var mirenglon = document.createElement('tr'); var fechacol = document.createElement('td'); var letrecol = document.createElement('td'); fechacol.setAttribute('id','columna_'+i); letrecol.setAttribute('id','renglon_'+i); fechacol.className='coursedata_date'; letrecol.className='coursedata_fecha'; mirenglon.appendChild(fechacol); mirenglon.appendChild(letrecol); document.getElementById('coursecal_table').appendChild(mirenglon); document.getElementById('columna_'+i).innerHTML = fecha; document.getElementById('renglon_'+i).innerHTML = letrero;
1- Is there a way to make IE "understand" that I am actually trying to modify the document's DOM?
2- if not, is there a way to "convert" an object created by createElement() into HTML so that I can then update the page using innerHTML?


Reply With Quote


Bookmarks