Re: Javascript / FireFox help needed



On Jul 21, 3:38 am, DutchMaster11 <DutchMaste...@xxxxxxxxx> wrote:
Can anyone tell me why the following code will work in IE7, but in in
Firefox (or any of its sub-browsers, like Flock)?

I haven't waded through all that code, but it seems that your issue is
with setting a TR's display attribute to 'block'. It is much better
to post a minimal example that shows the error.

In IE the default display property for TR elements is 'block', in
Firefox (and other browsers that have moved beyond CSS 1) it is 'table-
row'. Changing it to block most likely causes the error you
described.

[...]
<STYLE type="text/css">
<!--

HTML comments inside style elements are a waste of time, remove them.

[...]
<script language="JavaScript">

The language attribute is deprecated, type is required.

<!--


HTML comments inside script elements are a waste of time, remove them.

[...]
if (document.images) {
header_dl_over = new Image();
header_dl_over.src = "/images/header_download_over.jpg";
header_dl_off = new Image();
header_dl_off.src = "/images/header_download.jpg";

header_login_over = new Image();
header_login_over.src = "/images/header_login_over.jpg";
header_login_off = new Image();
header_login_off.src = "/images/header_login.jpg";

header_personalmenu_over = new Image();
header_personalmenu_over.src = "/images/
header_personalmenu_over.jpg";
header_personalmenu_off = new Image();
header_personalmenu_off.src = "/images/header_personalmenu.jpg";

header_support_over = new Image();
header_support_over.src = "/images/header_support_over.jpg";
header_support_off = new Image();
header_support_off.src = "/images/header_support.jpg";

menu_home_over = new Image();
menu_home_over.src = "/images/menu_home_over.jpg";
menu_home = new Image();
menu_home.src = "/images/menu_home.jpg";

menu_about_over = new Image();
menu_about_over.src = "/images/menu_about_over.jpg";
menu_about = new Image();
menu_about.src = "/images/menu_about.jpg";

menu_faqs_over = new Image();
menu_faqs_over.src = "/images/menu_faqs_over.jpg";
menu_faqs = new Image();
menu_faqs.src = "/images/menu_faqs.jpg";

menu_support_over = new Image();
menu_support_over.src = "/images/menu_support_over.jpg";
menu_support = new Image();
menu_support.src = "/images/menu_support.jpg";

menu_contact_over = new Image();
menu_contact_over.src = "/images/menu_contact_over.jpg";
menu_contact = new Image();
menu_contact.src = "/images/menu_contact.jpg";

}

function toggleTR(objID) {
var obj = document.getElementById('detail' + objID);
if (obj.style.display == 'block') { obj.style.display = 'none'; }
else { obj.style.display = 'block'; }}

Use something like:

obj.style.display = (obj.style.display == 'none')? '' : 'none';


This issue has been discussed many times, search the archives.


function changeImages() {
if (document.images) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src =
eval(changeImages.arguments[i+1] + ".src");

eval is very rarely needed:

... = changeImages.arguments[i+1] + ".src";


--
Rob


.



Relevant Pages

  • Re: RGPL - a couple of updates
    ... when I display the rankings on my machine using firefox 3.0.4 the ... Excel spreadsheet I'm exporting as an html, so I don't know how else do ... It might be an unrecognized font type or size, ... simply use an add on to Firefox that allows me to open links in IE. ...
    (rec.games.pinball)
  • Re: Firefox not displaying popup correctly
    ... Firefox and not in IE? ... popup component retrieve certain information in the xhtml page (through ... Now if I change the DOCTYPE to HTML instead of XHTML then it display ... yet I still get a post back unless I use the HTML instead of the XHTML. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: cannot view complete html source of webpage using browser
    ... that are inside the frames) ... (does not display the html text of the main ... After saving the page using browser firefox and use view source again ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Firefox not displaying popup correctly
    ... This displays fine in IE but it does not work right in Firefox. ... Now if I change the DOCTYPE to HTML instead of XHTML then it display ... yet I still get a post back unless I use the HTML instead of the XHTML. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Odd printing in FF
    ... This page (valid HTML): ... prints really oddly in FireFox, but OK in IE (as can be seen in "print ... preview" - no need to waste trees!) ...
    (uk.net.web.authoring)