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 JavaScript interpreter  and HTML comment? 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 "JavaScript interpreter  and HTML comment?" Watch "JavaScript interpreter  and HTML comment?" New topic
Author

JavaScript interpreter and HTML comment?

carl varola
Ranch Hand

Joined: May 16, 2002
Posts: 59
Why is the JavaScript interpreter not confused by the method for hiding JavaScript from obsolete browsers? I understand that enclosing the script within a comment will be interpreted simply as a comment by a browser lacking the JavaScript interpreter. But why is the interpreter not confused by the comment opening? Thus, the interpreter will see is simply a JavaScript comment.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Answer I have is that it was programmed to look for the tags. The eariler versions did not look at them so that is why they skip it. The other versions look at them and will also check to see what version is listed.
I from programmed this type of logic into things I have done with SQL, javaScript, & ASP.
Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaScript interpreter and HTML comment?