Jump to content

Comments?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
This actually parses code:


<!----

<script language="javascript">

document.write("Hello");

</script>

// -->


but in HTML isn't the <!-- a comment? Shouldn't this not work? Also, what do the // do?

#2
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Sometimes if I'm not wrong those are used to "hide" the code from old browsers, not sure though

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
These are used in JavaScript so that it will not display as text if the browser does not have a JavaScript Engine. In other words, if your browser didn't support it you would see that written as text. With the comments there you wouldn't see it.

#4
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
Ah, thanks for the explanation.