My dynamic table rendered by an AJAX call had alternating row colors – which as expected rendered beautifully in all the major browsers ( except IE of course ).
The row looked like this tr bgcolor=”#EFEFEF”
I had to push the bgcolor into an inline style and then IE started showing the row color.
tr style=”background-color:#EFEFEF”
Hope my IE posts get over, because to find every IE gotcha I spend quite a fair amount of my time.
And today I wasted an entire afternoon trying to figure out why IE will not render my dynamic table got from an AJAX call. And as usual all the other browsers were rendering the table without skipping a beat.
I stripped out everything till nothing was remaining in the table and still IE will not render the table.
Finally I found out the culprit. I did not have a tbody tag. UGhhhh.
Should I send a bill to Bill for all the wasted hours because of this inconsistent browser?
Thanks to IE refusing to play well on a dynamically loaded table with controls – I am learning new things.
Here is how to attach a function which takes parameters to a control.
document.getElementById(‘button’).onclick=new Function(“some_function(‘parameter’)”);
God bless IE.
This time the culprits were Chrome and IE.
The table I dynamically pulled had a select all button. But the onclick was never getting fired. The work around was quite simple. I had to attach the event to the control once again. Then the onclick event worked.
Attaching the event is quite simple.
document.getElementById(‘button’).onclick = functionName;
I would have spent more than an hour breaking my head with IE.
Problem : I have a table which is fetched using AJAX. Now this table has a thead with header contents and rendered fine in all the browsers except IE.
My code looked something like this
<table>
<thead>
<th>Name</th>
<th>Age</th>
</thead>
<tbody>
Solution : There should be a TR within the THEAD. Now the header started showing fine after the ajax call. The funny thing is – IE rendered it fine when this table was part of the page. When I moved it to be rendered from an AJAXy call this problem surfaced.
Now the code looks like this.
<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
Here is the life story of a speck