X
Tap here to go to the mobile version of the site.

Support Forum

Firefox 4 ignoring table (<td></td>) property

Posted

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

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 by Veekay

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)

Read this answer in context 0

Additional System Details

Installed Plug-ins

  • LogMeIn, Inc. Remote Access Components
  • 2,5,3,1
  • Office Plugin for Netscape Navigator
  • np-mswmp
  • 6.0.12.688
  • RealPlayer(tm) LiveConnect-Enabled Plug-In
  • RealJukebox Netscape Plugin
  • Adobe PDF Plug-In For Firefox and Netscape 8.2.4
  • Default Plug-in
  • Shockwave Flash 10.1 r82
  • iTunes Detector Plug-in
  • DivX Web Player version 2.0.2.40
  • 4.0.50524.0
  • Veoh Web Video Player Browser Plugin
  • Java Plug-in 1.6.0_07 for Netscape Navigator (DLL Helper)
  • The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.

Application

  • User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17530 solutions 158508 answers

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)

That is because the code is wrong.<br /> 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.<br /> <pre><nowiki><td id="navSearchBar" class="navSearchBar">Search</td></nowiki></pre> You need to add &lt;table&gt; &lt;/table&gt; around the code. This code should work: <pre><nowiki> 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; </nowiki></pre> ''(corrected text that got removed by a previous edit)''

Modified by cor-el

Question owner

Thank you so much for your help.

Is there a way i can sent you a private message. :-)

Thank you so much for your help. Is there a way i can sent you a private message. :-)
cor-el
  • Top 10 Contributor
  • Moderator
17530 solutions 158508 answers

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.

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 by cor-el