Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript interpreter and HTML comment?

 
carl varola
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic