Forum Moderators: open
The problem goes away when I change the -- to any other character.
If you try putting the page through the W3C validator I think you'll get an "invalid comment syntax" error, so its Mozilla being fussy as opposed to buggy.
Drove me mad untill I posted it here and Papabaer sorted me out.. Only solution I found was not to put -- in comments...
<added>I was using a 4.01 Transitional Doctype</added>
I just chose to use the - as a means of elongating the comment to cover a line for my own benefit.
Line 15, column 58: S separator in comment declaration
mail_str += "&body= I thought this would interest you -- " + document.title;
^
Line 15, column 59: invalid comment declaration
mail_str += "&body= I thought this would interest you -- " + document.title;
The parser appears not like -- anywhere, even inside strings!
function mailPage() {
var mail_str = "mailto:?subject= " + document.title;
mail_str += "&body= I thought this would interest you -- " + document.title;
mail_str += ". You should check this out at, " + location.href;
location.href = mail_str;
return true;
}
I generally develop pages with some javascript in them and when finished I move the js to an external file.
I Just think the parser has trouble with hyphens --, especially two of them, even when contained in a string. It automatically assumes they are part of a comment.
PS. This site is a great help to me.
From the W3C...
White space is not permitted between the markup declaration open delimiter("<!") and the comment open delimiter ("--"), but is permitted between the comment close delimiter ("--") and the markup declaration close delimiter (">"). A common error is to include a string of hyphens ("---") within a comment. Authors should avoid putting two or more adjacent hyphens inside comments.
3.2.4 Comments [w3.org]
See...
[webmasterworld.com...]
[webmasterworld.com...]
reeeallly interesting reading.
I can personally attest to the fact, that xhtml served as application/xhtml+xml is interpreted *very* strictly in Mozilla and is a superb way of testing for valid markup - especially on dynamically generated php & mysql xhtml pages.