Firefox 4 ignoring table (<td></td>) property
I am working on upgrading the extension https://addons.mozilla.org/en-US/firefox/addon/156940/ for Firefox 4 compatibility.
Basically the extensions enhances the website by adding few query fields which are enclosed in the '<td></td>' format. Until FF 3.6.9, there are no issues. But in FF 4, it is ignoring <td></td> properties.
But it works with out any issues on latest releases of chrome and safari
Modified
Chosen solution
That is because the code is wrong.
You're lucky that it works in Firefox 3.6 , but Firefox 4.0 is more strict.
You try to add TD elements to the innerHTML of another TD element and that doesn't work.
<td id="navSearchBar" class="navSearchBar">Search</td>
You need to add <table> </table> around the code.
This code should work:
if (lsa[0] == "jp") { searchTxt = "<table><td style=\"font-weight:bold; font-size:13px; padding-right:5px;\"><span style=\"float:left; width:28px;\">" + searchTxt + "</span></td>"; } else { searchTxt = "<table><td style=\"font-weight:bold; font-size:13px; padding-right:5px;\">" + searchTxt + "</td>"; } if (lsa[0] != "ca") { searchTxt += "<td style=\"padding-left:3px;\"><select id=\"p_76\" name=\"p_76\"><option value=''>Any<option value='1'>Prime<option value='1-'>Free</select></td>"; } searchTxt += "<td style=\"padding-left:3px;\"><select id=\"pct-off\" name=\"pct-off\"><option value=''>0-100% <option value='10-'>10% <option value='20-'>20% <option value='30-'>30% <option value='40-'>40% <option value='50-'>50% <option value='60-'>60% <option value='70-'>70% <option value='80-'>80% <option value='90-'>90%</select></td></table>"; searchObj.innerHTML = searchTxt;
(corrected text that got removed by a previous edit)
All Replies (3)
Chosen Solution
That is because the code is wrong.
You're lucky that it works in Firefox 3.6 , but Firefox 4.0 is more strict.
You try to add TD elements to the innerHTML of another TD element and that doesn't work.
<td id="navSearchBar" class="navSearchBar">Search</td>
You need to add <table> </table> around the code.
This code should work:
if (lsa[0] == "jp") { searchTxt = "<table><td style=\"font-weight:bold; font-size:13px; padding-right:5px;\"><span style=\"float:left; width:28px;\">" + searchTxt + "</span></td>"; } else { searchTxt = "<table><td style=\"font-weight:bold; font-size:13px; padding-right:5px;\">" + searchTxt + "</td>"; } if (lsa[0] != "ca") { searchTxt += "<td style=\"padding-left:3px;\"><select id=\"p_76\" name=\"p_76\"><option value=''>Any<option value='1'>Prime<option value='1-'>Free</select></td>"; } searchTxt += "<td style=\"padding-left:3px;\"><select id=\"pct-off\" name=\"pct-off\"><option value=''>0-100% <option value='10-'>10% <option value='20-'>20% <option value='30-'>30% <option value='40-'>40% <option value='50-'>50% <option value='60-'>60% <option value='70-'>70% <option value='80-'>80% <option value='90-'>90%</select></td></table>"; searchObj.innerHTML = searchTxt;
(corrected text that got removed by a previous edit)
Modified
Thank you so much for your help.
Is there a way i can sent you a private message. :-)
You're welcome. I noticed that I accidentally removed some text while trying to make the code show properly, and I've tried to correct that.
This forum doesn't have a private message feature.
Modified