File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes simple output statements inputted in the comment section yet it is printing out in the webpage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "simple output statements inputted in the comment section yet it is printing out in the webpage" Watch "simple output statements inputted in the comment section yet it is printing out in the webpage" New topic
Author

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

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055




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" ' \


http://www.lifesbizzare.blogspot.com || OCJP:81%
Piyush Joshi
Ranch Hand

Joined: Jun 10, 2011
Posts: 207

Because you are using wrong comment tags.
Inside Javascript you should use /* */ instead of <!-- -->.


Piyush
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
<!-- 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

Joined: Aug 01, 2009
Posts: 1055

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
That book is fine.

More advanced book is JavaScript: The good parts.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simple output statements inputted in the comment section yet it is printing out in the webpage