Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple output statements inputted in the comment section yet it is printing out in the webpage

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



simple output statements inputted in the comment section yet it is printing out in the webpage!! I mean if they are within comment how are they printable

Output:
Here are some escaped characters" ' \
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you are using wrong comment tags.
Inside Javascript you should use /* */ instead of <!-- -->.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<!-- and --> inside of JavaScript is ancient ways of hiding the JavaScript content from browsers that did not understand JavaScript. You are taling brwsers over 12 years old. Hence they are not needed anymore. Modern day browsers ignore those html comments inside the script tags.

Eric

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:<!-- and --> inside of JavaScript is ancient ways of hiding the JavaScript content from browsers that did not understand JavaScript. You are taling brwsers over 12 years old. Hence they are not needed anymore. Modern day browsers ignore those html comments inside the script tags.

Eric



Hi Eric,
I am a bit rusty on javascript and i saw Head first start book and iguess its too old now.Please guide me which book to refer to learn scripting with respect to moderan browsers
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That book is fine.

More advanced book is JavaScript: The good parts.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic