Forum Moderators: open

Message Too Old, No Replies

Comments appearing in webpage

commented text is displaying in the webpage

         

dotancohen

2:58 pm on Jun 8, 2006 (gmt 0)

10+ Year Member



In this code, the comments get shown on the screen:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Basics</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type='text/css'>
<!--
* { padding:0; margin:0; }
p,h1,h2,h3,h4,h5,h6 { margin-top: 1em; margin-bottom: 0px; margin-right: 0px; margin-left: 0px; }
h1 { display: inline; }
ul,ol { list-style:none ; margin-left:15px; }
a img,:link img,:visited img { border:none }
body { background-color: #F7F5F7; color: #000000; }
a:link { color: #3333cc; text-decoration: none; }
a:hover { color: #cc3333; }
a:active { color: #cc3333; }
a:visited { color: #3333cc; text-decoration: none; }
.placeholder { color: #703070; }
.commandLine { background-color: #000000; color: #ffffff; font: serif; width: 50%; }
-->
</style>
</head>
<body>

<div class="header">
</div>

<div class="content">
<h2>Installing Software From Source</h2>
<p>Lots of text here:</p>
<div class="commandLine"><pre>
$ wget http://example.com/folder/tarball.bz2
</pre></div>
<p>And there are the steps for installing software compressed in gz files:</p>

<div class="commandLine"><pre>
$ tar -xvzf downloadedFile.tar.gz
$ cd downloadedFile-folder
$ ./configure
$ make
$ su
# make install
# logout
</pre></div>

[b]<!--
wget url-to-tar.bz2-file
tar -xvvjf tar.bz2-file
cd brand-new-folder
./configure --prefix=/usr/local
make
su #and enter your root pass when asked
make install
ldconfig #not always needed, but can't hurt
exit
-->[/b]

<p><br /></p>
</div>

<div class="footer">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&copy; 2005-2006 example.com</div>

</body>
</html>

Why should that code get displayed? Thanks.

Dotan Cohen

[edited by: encyclo at 3:16 pm (utc) on June 8, 2006]
[edit reason] examplified, simplified and fixed formatting [/edit]

pageoneresults

3:04 pm on Jun 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<!-- 
wget url-to-tar.bz2-file
tar -xvvjf tar.bz2-file
cd brand-new-folder
./configure --prefix=/usr/local
make
su #and enter your root pass when asked
make install
ldconfig #not always needed, but can't hurt
exit
-->

See those two dashes in front of the prefix? That's where the problem is.

[w3.org...]

<added> encyclo caught my first reply which was totally off base. I caught it too, but just in time before encyclo posted. ;)

[edited by: pageoneresults at 3:12 pm (utc) on June 8, 2006]

encyclo

3:09 pm on Jun 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem can be found via the HTML validator [validator.w3.org]:

Error Line 98 column 14: invalid comment declaration: found name start character outside comment but inside comment declaration.

./configure --prefix=/usr/local

The double-hyphen in the code acts as a comment declaration when you're in standards-compliance mode.

See:

[developer.mozilla.org...]

<added> you're too fast for me ;) </added>

[edited by: encyclo at 3:18 pm (utc) on June 8, 2006]

Fotiman

3:15 pm on Jun 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As a side note, be sure to use the Validator whenever weird things happen. Make it your first course of action, as it often times will reveal something about your code that you might not have been aware of.

Also, your code above is not valid. If you're going to use XHTML, then you really should consider making your code validate. If you're really just serving up HTML, then use the HTML 4.01 DOCTYPE instead.

dotancohen

3:24 pm on Jun 8, 2006 (gmt 0)

10+ Year Member



Thanks, I didn't know that -- was the beginning of a comment in standards-compliance mode. I'd be more careful in the future.

As for the pages not validating, they are now! I needed to get the header graphic and title up quickly, and ran into a problem with the CSS, so I did a table with two errors in it! I corrected the errors and in any case, that table will soon be history when I publish the site layout.

Thanks, everybody!