I've come across a code snippet that works perfectly in all browsers except IE. Here it is:
var array = eval( '(' + xmlHttp.responseText + ')' );
var html = '';
for(var key in array)
{
html += '<option value="' + key + '">' +array[key] + '</option>';
}
alert(html);
document.getElementById('countries').innerHTML = html;
The problem seems to be with the .innerHTML
property. While the alert displays the data correctly, the innerHTML removes the tags and displays the words in a row.
Any suggestions on how to potentially resolve this issue?