Kako u plain HTML-u detektirati postojanje/verziju M$ Internet Explorera?
Internet Explorer 5.0 i veće verzije prepoznaje neke uvjete unutar HTML komentara, tzv. conditional comments
Ostali browseri zanemarit će cijeli takav blok kao običan HTML komentar.
Evo primjera:
<body>
<!--[if IE]>
According to the conditional comment, this is Internet Explorer.
<![endif]-->
<!--[if IE 5]>
According to the conditional comment, this is Internet Explorer 5.
<![endif]-->
<!--[if IE 5.0]>
According to the conditional comment, this is Internet Explorer 5.0.
<![endif]-->
<!--[if IE 5.5]>
According to the conditional comment, this is Internet Explorer 5.5.
<![endif]-->
<!--[if IE 6]>
According to the conditional comment, this is Internet Explorer 6.
<![endif]-->
<!--[if gte IE 5]>
According to the conditional comment, this is Internet Explorer 5 and up.
<![endif]-->
<!--[if lt IE 6]>
According to the conditional comment, this is Internet Explorer lower than 6.
<![endif]-->
<!--[if lte IE 5.5]>
According to the conditional comment, this is Internet Explorer lower or equal to 5.5.
<![endif]-->
</body>
Za više informacija vidi ovdje.
Updated by dpavlin@hidden on Nov 17 3:03pm
Posted by dpavlin@hidden on Nov 17 2:41pm
|
Weblog Navigation
Loading...
|