Vanishing DIV in Mozilla

Warning Mozilla users! The page as you are seeing it is incomplete (no navigation, no footer...) See the coding index if you want something un-broken.

::: discussion :::

Explanation and Solution

Two nice people I know (Script and Davezilla) had a similar problem, which found a similar resolution: having redesigned their sites, a <div> at the bottom of their pages refused to display in Mozilla.

In both cases, the vanishing <div> came just after the code required for a popular stats and counter service: Sitemeter. By removing the sitemeter code and placing it at the very end of the page (just before the </body> tag), the vanishing <div> displayed normally.

I've narrowed down the culprit to these two lines:

<script type="text/javascript">var site="sm5tarastar"</script>
<script type="text/javascript" src="http://sm5.sitemeter.com/js/counter.js?site=sm5tarastar"></script>

I'm not quite sure yet why it does it, though. Peruse the :::discussion::: above if you have any bright ideas! Workarounds are welcome too, as the present one simply avoids the problem by not placing anything important after the sitemeter code.

Updates:

Technical Considerations

I've been doing some experiments to narrow down the problem. Here is what I've come up with.

If both lines of code are included, the rest of the page is not displayed. It is exemplified on this page (Mozilla users will have to view source to understand).

If only the first line of code is included, the end of the page seems to display normally.

If only the second line of code indicated above is included (that is, if you remove the first line), the <div> which follows it will display, but with a surprise in store (demonstrated in the next two paragraphs—code and screenshot of result).

Code

<script type="text/javascript" src="http://sm5.sitemeter.com/js/counter.js?site=sm5tarastar"></script>

<div style="border: 1px solid black; font-weight: bold; font-size: 1.2em; color: red;"> Mozilla users don't see this! </div>

Well, they do, but I didn't know that yet when I did the experiment!

Result in Mozilla

Screenshot of the result in Mozilla.

Note the path in the status bar. Note too that the text in question was coded as plain text, and not as a link! I highly suspect the beginning of the answer to the why question lies in what you see here.

Demonstration

I've included just below this paragraph the sitemeter code which creates this trouble, followed by some text which Mozilla users should not see (and of course, they won't get the footer and bottom of my page either - but that's a small price to pay):

Mozilla users: view source!

Mozilla users now see this! [Thanks, Andrew]

This site will look much more pretty in a browser which supports web standards, but it is accessible to any browser or Internet device. Browsers which do not support CSS will get this message, even if they are otherwise standards-compliant. Do you want to upgrade?

French - français! Ce site aura l'air bien plus joli dans un navigateur conforme aux standards du web, mais il est accessible avec n'importe quel navigateur ou dispositif Internet. Désirez-vous faire une mise à jour?