473,508 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

were does this HTML syntax come from?

Looking at an HTML document recently, I found this syntax which was
completely new to me

<![if !supportAnnotations]>
<style>...</style>
<![endif]>

it looks to be some kind of conditional logic but it's not in a javascript
block, just in the normal HTML markup. none of by browsers took exception to
it

there was no attempt to define or set the variable "supportAnnotations"
anywhere, so I'm not sure if it's referencing some built-in variable or
what.

Can anyone point me at anything which explains this syntax?

TIA

Andy
Jul 23 '05 #1
15 3825
Andy Fish wrote:
Looking at an HTML document recently, I found this syntax which was
completely new to me

<![if !supportAnnotations]>
<style>...</style>
<![endif]>


It's proprietary garbage invented by Microsoft which will only work in
their so-called Web browser. You shouldn't try to use it on the public
Internet.
Jul 23 '05 #2


Andy Fish wrote:
Looking at an HTML document recently, I found this syntax which was
completely new to me

<![if !supportAnnotations]>
<style>...</style>
<![endif]>

it looks to be some kind of conditional logic but it's not in a javascript
block, just in the normal HTML markup. none of by browsers took exception to
it

there was no attempt to define or set the variable "supportAnnotations"
anywhere, so I'm not sure if it's referencing some built-in variable or
what.

Can anyone point me at anything which explains this syntax?


It is likely an attempt to use MS IE's conditional comments:
http://msdn.microsoft.com/library/de...omment_ovw.asp

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3
Leif K-Brooks <eu*****@ecritters.biz> wrote in news:312vh2F35vu4nU1@uni-
berlin.de:
Andy Fish wrote:
Looking at an HTML document recently, I found this syntax which was
completely new to me

<![if !supportAnnotations]>
<style>...</style>
<![endif]>


It's proprietary garbage invented by Microsoft which will only work in
their so-called Web browser. You shouldn't try to use it on the public
Internet.


Using a form of these conditional comments is very useful for filtering
hacks or content to specific versions of Internet Explorer, though:

http://www.quirksmode.org/css/condcom.html

Validates, and all non-IE browsers will ignore it.

--
paul haine
http://joeblade.com/
http://design.joeblade.com/
Jul 23 '05 #4
Andy Fish wrote:
Looking at an HTML document recently, I found this syntax which was
completely new to me <![if !supportAnnotations]>
<style>...</style>
<![endif]>


The ! generally indicates this is a comment.
Looks like maybe the author uses them for his own purposes and fails to
remove them.
There is nothing in standard html that supports <![ ]>.

Jul 23 '05 #5
On Sat, 4 Dec 2004, Richard wrote:
> <![endif]>


The ! generally indicates this is a comment.


Not to anyone who understands HTML, it doesn't.

Don't you recognise a Microsoftism when you see one?
Jul 23 '05 #6
On Sat, 4 Dec 2004 09:58:38 -0600, "Richard" <An*******@127.001> wrote:
Andy Fish wrote:
Looking at an HTML document recently, I found this syntax which was
completely new to me <![if !supportAnnotations]>
<style>...</style>
<![endif]>
The ! generally indicates this is a comment.
BEEP, ALARM, BEEP (i.e. that is not correct)

The '<!' char sequence is a "Markup Declaration Open" mark as per the
SGML Concrete Reference Syntax and it's as correct in HTML as it is in
better applications of SGML.
There is nothing in standard html that supports <![ ]>.


That is correct, but probably you do not understand the real reason why.

SGML (and thus HTML) defines '<!' + '[' as the start of a "Marked
Section" and a marked section opener must be followed by a valid "Status
Keyword". A correct marked section would be as in following example.

<![ IGNORE [Anything in here will be ignored by an SGML parser]]>

Looking back at the example markup that started this thread it can be
clearly stated that the word 'if' is not a correct SGML status keyword
and thus the whole example becomes totally invalid from an SGML (HTML)
standpoint.

If it "works" for some level of "works" in today's browsers that is all
because of existing buggy behavior in those browsers.

This setup OTOH...

<!--[if !supportAnnotations]>
<style>...</style>
<![endif]-->

....would make for the construct to be a valid comment for all browsers,
except for MSIE which happens to be programmed to process certain
contents of SGML comments as a sort of a "private programming language".

For the one who really wants to bother his mind with e.g. style sheet
designs that gives similar rendering on all browsers, including MSIE,
the MS "Conditional Comment" thingy could be used to set up the specific
error correction styling that IE needs to behave decent visavi already
decent browsers.

--
Rex
Jul 23 '05 #7
On Wed, 1 Dec 2004, paul haine wrote:
<![if !supportAnnotations]>
<style>...</style>
<![endif]>

Using a form of these conditional comments


Petitio principii. The above are not "comments", not in HTML, not in
SGML.
is very useful for filtering
hacks or content to specific versions of Internet Explorer, though:

http://www.quirksmode.org/css/condcom.html
Fairynuff, but the cited URL refers to

|| <!--[if IE]>
Validates,
Don't you see the difference?
and all non-IE browsers will ignore it.


The latter form is a comment, right.

The cited form, if it happens to validate, is sheer happenstance.
Lord knows what an SGML browser would make of it.

Where's Arjun Ray when we need him? ;-)
Jul 23 '05 #8
On Sun, 5 Dec 2004 22:59:18 +0000, "Alan J. Flavell"
<fl*****@ph.gla.ac.uk> wrote:

[...]
Where's Arjun Ray when we need him? ;-)


Good question, and I would be the first to really applaud his
reappearance here.

From what I know, in concentrated form...

Arjun had his company office on the south end of Manhattan.
When the twin towers fell down, his point of business became isolated
south of the street that the US authorities decided to use as a
"terrorist" border line (and that included total electronic isolation).

Suffice to say that Arjun lost all contact with his present, and future
potential, clients because of this, and he had to close down his
operation.

He managed to moved some of the more important records over to his own
apartment located straight east and over the water from his Manhattan
office, but basically; since the authorities did not even give
permission for him to visit his own office, he was stumped.

I have no accurate knowledge of his whereabouts today; last record I
could find on Usenet is in rec.pets.cats.*

(Arjun loves Cats as "mans best friend" and so do I, so we do have that
in common at least)

--
Rex
Jul 23 '05 #9
On Sun, 5 Dec 2004 22:59:18 +0000, Alan J. Flavell <fl*****@ph.gla.ac.uk>
wrote:
On Wed, 1 Dec 2004, paul haine wrote:


[snip]
http://www.quirksmode.org/css/condcom.html


Fairynuff, but the cited URL refers to

|| <!--[if IE]>


However, what the article fails to mention is that there is a difference
between

<![...]> and <!--[...]>

As the article states, conditional comments are only understood by IE5+.
The first form of comment allows earlier IE versions to parse the contents
of the "comment" (Microsoft use the term, "downlevel-revealed"), whilst
the second form does not ("downlevel-hidden"). So, which form you use may
be of some importance.

See
<URL:http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>.

Opera users: You may need to either disable Javascript or spoof as IE
before viewing the document above. Microsoft seem intent on redirecting to
their tree-based navigation system which is incompatible with Opera.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #10
On Mon, 6 Dec 2004, Michael Winter wrote:
On Sun, 5 Dec 2004 22:59:18 +0000, Alan J. Flavell <fl*****@ph.gla.ac.uk>
wrote:
On Wed, 1 Dec 2004, paul haine wrote:
[snip]
http://www.quirksmode.org/css/condcom.html


Fairynuff, but the cited URL refers to

|| <!--[if IE]>


However, what the article fails to mention is that there is a difference
between

<![...]> and <!--[...]>


Quite! Which was indeed the point that I was trying to bring out.
The first form of comment
There's only one form of comment there. The other is something else.
So, which form you use may be of some importance.
I don't see any particular objection to using the comment (by those
who want to treat IE differently than a WWW browser, I mean) - not
even in a WWW context.

The other one is a different matter, though.
See
<URL:http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>.


Sure. Then see what an SGML parser makes of the other one.

MS (ignorantly|mischievously) -calling- it a comment does not
miraculously make it into one.

Jul 23 '05 #11
On Mon, 6 Dec 2004 13:36:04 +0000, Alan J. Flavell <fl*****@ph.gla.ac.uk>
wrote:
On Mon, 6 Dec 2004, Michael Winter wrote:
[snip]
However, what the article fails to mention is that there is a
difference between

<![...]> and <!--[...]>


Quite! Which was indeed the point that I was trying to bring out.


I was referring to the functional difference, but I am aware of the fact
that <![ is not in any way an actual comment delimiter. It was certainly
not my intention to imply otherwise.
The first form of comment


There's only one form of comment there. The other is something else.


Instances of 'comment' in my previous post should have been quoted in a
gesture of acknowledgement. In the end, only one was.

[snip]
MS (ignorantly|mischievously) -calling- it a comment does not
miraculously make it into one.


Absolutely! Again, I was simply drawing attention to the functional
difference that Microsoft applies to the two forms, and that the second
form above is not necessarily an equivalent replacement of the first.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #12
On Wed, 01 Dec 2004 16:03:48 +0000, paul haine wrote:
Using a form of these conditional comments is very useful for filtering
hacks or content to specific versions of Internet Explorer, though:


Indeed. Here is an example:

http://www.nyct.net/~aray/

(with thanks to Alan Flavell for suggesting an "improvement").

--
The day Microsoft makes something that doesn't suck is probably the
day they start making vacuum cleaners. -- Ernst Jan Plugge
Jul 23 '05 #13
On Mon, 06 Dec 2004 02:10:56 +0100, Jan Roland Eriksson wrote:
I have no accurate knowledge of his whereabouts today;
To the consternation and despair of many, I'm still around, in the same
place. The usual e-ddresses still work, too (except the q2.net one).
last record I could find on Usenet is in rec.pets.cats.*


Yes, I follow those groups regularly.
Jul 23 '05 #14
On Sun, 12 Dec 2004 05:03:23 GMT, "Arjun Ray" <ar**@nmds.com.invalid>
wrote:
On Mon, 06 Dec 2004 02:10:56 +0100, Jan Roland Eriksson wrote:
I have no accurate knowledge of his whereabouts today;
To the consternation and despair of many, I'm still around, in the same
place...


Welcome back; you have been missed :-)

--
Rex
Jul 23 '05 #15
In article <pa****************************@nmds.com.invalid >,
"Arjun Ray" <ar**@nmds.com.invalid> writes:
I have no accurate knowledge of his whereabouts today;


To the consternation and despair of many, I'm still around, in the same
place. The usual e-ddresses still work, too (except the q2.net one).


Yay! Welcome back to the madhouse. Can I look forward to further
enlightement of a technical nature?

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/
Jul 23 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
5641
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
7
2478
by: WindAndWaves | last post by:
Hi Gurus I am just putting my first PHP site together... One thing that I think it strange is that I do not seem to be able to view the source. It is almost like the page does not load...
2
2964
by: news frontiernet.net | last post by:
I have key entered and tried to run example 4-6 from Dany Goodmans DYNAMIC HTML book, version one that is on pages 94-96. This is part of my effort to learn JavaScript. I checked each byte and...
17
2295
by: Mike Hofer | last post by:
While I'd toyed with C, C++, and Java over the last 20 years or so, my principal language has been BASIC, QBASIC, then Visual Basic, and finally Visual Basic .NET. But lately, I've been using C#...
22
2834
by: Gianni Rondinini | last post by:
hi all. please excuse the misusage of some tech terms, but writing in english is not as easy as in italian :) i'm designing our new website and, since i want to do something that will last as...
12
2234
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
44
2790
by: rhythmace | last post by:
W3C HTML validator passes this: .... <script type="text/javascript" src="foo.js"> <script type="text/javascript"> ....script in here... </script> ....
0
2987
by: U S Contractors Offering Service A Non-profit | last post by:
" Visionary Dreams " " Leaving New york City leaving to go " GOD noes were i Don't "
0
1521
by: 2Barter.net | last post by:
Craig Oral Somerford Founder of said Non-profit given to GOD through faith watch wave to see: On "CLICK" http:// www.2Barter.net 09 mar 2007...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.