Hello, I'm new to jQuery and I've been playing around with an example I found regarding xml consumption. The thing is it works perfectly in every browser, except IE, where it only displays the tables headers. I'm sure many of you here have already seen something like this. Here is the code:
/**********************************************************************************/ // Start function when DOM has completely loaded $(document).ready(function(){ // Open the xml file $.get("data.xml",{},function(xml){ // Build an HTML string dataTable = ''; dataTable += '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="Data">'; dataTable += '<th width="28%" scope="col">Data1</th><th width="33%" scope="col">Data2</th><th width="23%" scope="col">Data3</th><th width="16%" scope="col">Data4</th>'; // Run the function for each data tag in the XML file $('data',xml).each(function(i) { data1 = $(this).find("data1").html(); data2 = $(this).find("data2").html(); data3 = $(this).find("data3").html(); data4 = $(this).find("data4").html(); // Build row HTML data and store in string mydata = BuildDataHTML(data1,data2,data3,data4); dataTable = dataTable + mydata; }); dataTable += '</table>'; // Update the DIV called Content Area with the HTML string $("#div_Id").append(dataTable); }); }); function BuildDataHTML(data1,data2,data3,data4){ // Build HTML string and return output = ''; output += '<tr>'; output += '<td valign="top">'+ data1 +'</td>'; output += '<td valign="top">'+ data2 +'</td>'; output += '<td valign="top">'+ data3 +'</td>'; output += '<td valign="top">'+ data4 +'</td>'; output += '</tr>'; return output; } /**********************************************************************************/ Seems to me like IE skips this part: /**********************************************************************************/ ]// Run the function for each data tag in the XML file $('data',xml).each(function(i) { data1 = $(this).find("data1").html(); data2 = $(this).find("data2").html(); data3 = $(this).find("data3").html(); data4 = $(this).find("data4").html(); // Build row HTML data and store in string mydata = BuildDataHTML(data1,data2,data3,data4); dataTable = impactDataTable + mydata; }); /**********************************************************************************/ Any help would be greatly appreciated. -- View this message in context: http://www.nabble.com/XML-data-consumption-issue-with-Internet-Explorer-tp20853767s27240p20853767.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.