Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Not being displayed in IE


  • From: lists at dwsasia.com (Peter Lauri)
  • Subject: [Javascript] Not being displayed in IE
  • Date: Thu Dec 14 18:40:15 2006

Hi group,

I have gotten a weird thing going on. I have confirmed that the below code
works well in Firefox and Opera. However, in IE there is something strange
going on.

As you see in the code there are <tr> being created and put into a table. I
have confirmed that all the <tr> are being inserted into the table in IE by
counting and traversing the DOM for the table. However, the table does not
change as it should :(

Is there something special that needs to be done when doing this kind of
thing in IE? Note that sc is a multidimensional array.

Best regards,
Peter Lauri

function populateCartGraphic(sc) {
	summarytable = document.getElementById("summary_table");
	
	while(summarytable.childNodes.length >= 1) {
		summarytable.removeChild(summarytable.firstChild);
	}
	
	total = 0;
	
	for(i=0; i<sc.length; i++) {
		newrow = document.createElement('tr');
		temp1 = document.createElement('td');
		temp1.innerHTML = sc[i][1] + ", " + sc[i][2];
		newrow.appendChild(temp1);


		temp1 = document.createElement('td');
		temp1.innerHTML = "&pound;" + sc[i][3];
		newrow.appendChild(temp1);
		
		temp1 = document.createElement('td');
		temp1.innerHTML = sc[i][4];
		newrow.appendChild(temp1);

		linetotal = sc[i][3]*sc[i][4];
		
		temp1 = document.createElement('td');
		temp1.innerHTML = "&pound;" + linetotal;
		newrow.appendChild(temp1);
		
		summarytable.appendChild(newrow);

		total += linetotal;

	}
	
	
	newrow = document.createElement('tr');
	temp1 = document.createElement('td');
	temp1.innerHTML = " ";
	newrow.appendChild(temp1);


	temp1 = document.createElement('td');
	temp1.innerHTML = " ";
	newrow.appendChild(temp1);
	
	temp1 = document.createElement('td');
	temp1.innerHTML = " ";
	newrow.appendChild(temp1);
	
	temp1 = document.createElement('td');
	temp1.innerHTML = "&pound;" + total;
	newrow.appendChild(temp1);
	
	summarytable.appendChild(newrow);
	
}