Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes anyone know the do's and don't of commenting in FireFox 3.x?
    text
    copied!<p>I decided to show a breaking version of what I am talking about. It is not important how it messes up the layout, only that it causes the DIV element to be null....</p> <pre><code> &lt;!-- [ top panel ] --&gt;&lt;div id="top_panel"&gt; &lt;!-- -------------------------------------- --&gt; &lt;script type="text/javascript"&gt; alert(document.getElementById('top_panel')); &lt;/script&gt; &lt;/div&gt; </code></pre> <p>The above code will return the element as null, every time.... if I increase or decrease the number of dashes it still fails as long as the interior dashes end with a closing pair of dashes. For the sake of example, I will use [open] and [close] to represent pairs of "--" dashes...</p> <p>So, the code ends up being interpreted this way to break:</p> <pre><code> &lt;!-- [close][open][close][open][close][open][close][open][close] --&gt; </code></pre> <p>In this example, it is the last [close] and the "-->" which now cause an open, hanging comment.</p> <p>I only seem to run into comment-based issues in FF these days. All other browsers seem okay with anything I have thrown at them...</p> <p>I KNOW that this is not considered legal commenting, but it still does not change the fact that I had to trip over this situation to become aware of the issue... I am hoping others can avoid the same simple problem and share their own twists on weird, comment-based issues in any browser... I am sure this is not the only instance of good commenting gone bad.</p> <p>I also understand that leaving a space after the "&lt;" is a no-no as well: "&lt;" + " " + "!" + "--" = Nooooo!</p> <p>Thanks for all your help, all!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload