wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JavaScript interpreter and HTML comment?
 
Similar Threads
Interpretor Pattern: Need Help
Where is JavaScript Processed?
Bogus Error in NetBeans 6.8 Editor
Doubt in Overloading
Create dynamic code