aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Not familiar with this syntax 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 "Not familiar with this syntax" Watch "Not familiar with this syntax" New topic
Author

Not familiar with this syntax

M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 388
In a JSP I am working on, I see this...

<!--[if IE]>

<![endif]-->

What language is this? Also, IE 10 does not recognize it.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

If you look closely at the syntax, you'll see that's just an HTML comment. All browsers but IE just ignore it as a comment.

IE parses the comment and treats it as a conditional. It's completely non-standard.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

Another variant you might come across (this comes from HTML5 Boilerplate):


Again notice how it's just a comment that will be ignored non-IE browsers.
M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 388
I see, thank you. I will change it to JSTL's c:if
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

Why? If it works, why upset the apple cart?
Pavel Sok
Greenhorn

Joined: Nov 23, 2013
Posts: 10
Such HTML statement is used in creating forks during the parsing web page by browsers. So use this instead of propagating unnecessary JSTL's tags.
 
wood burning stoves
 
subject: Not familiar with this syntax