Pogledajte određenu poruku
Staro 12. 07. 2009.   #1
duki
novi član
Na probnom radu
 
Avatar duki
 
Datum učlanjenja: 01.08.2007
Lokacija: Beograd
Poruke: 10
Hvala: 1
0 "Hvala" u 0 poruka
duki is on a distinguished road
Pošaljite ICQ poruku za duki Pošaljite poruku preko MSN za duki
Question Conditional Comments stripper/validator

Hello!
Evo standardnog conditional commenta za IE:

Kôd:
<p><!--[if IE]>
According to the conditional comment this is Internet Explorer<br />
<![endif]-->
<!--[if IE 5]>
According to the conditional comment this is Internet Explorer 5<br />
<![endif]-->
<!--[if IE 5.0]>
According to the conditional comment this is Internet Explorer 5.0<br />
<![endif]-->
<!--[if IE 5.5]>
According to the conditional comment this is Internet Explorer 5.5<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is Internet Explorer 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is Internet Explorer 7<br />
<![endif]-->
<!--[if gte IE 5]>
According to the conditional comment this is Internet Explorer 5 and up<br />
<![endif]-->
<!--[if lt IE 6]>
According to the conditional comment this is Internet Explorer lower than 6<br />
<![endif]-->
<!--[if lte IE 5.5]>
According to the conditional comment this is Internet Explorer lower or equal to 5.5<br />
<![endif]-->
<!--[if gt IE 6]>
According to the conditional comment this is Internet Explorer greater than 6<br />
<![endif]-->
</p>
Naravno, taj kod može biti daleko komplikovaniji.
Postoji li neki skript (PHP?) ili program (još ako ima za Linux - iha!) kome može da se prosledi HTML fajl (koji sadrži conditional comment) i "verzija" IE-a a da se kao rezultat dobije čist HTML koji odgovara toj verziji?

Primer:
ccomment.html:
Kôd:
<p>
<!--[if IE 5]>
According to the conditional comment this is Internet Explorer 5<br />
<![endif]-->
<!--[if IE 5.0]>
According to the conditional comment this is Internet Explorer 5.0<br />
<![endif]-->
<!--[if IE 5.5]>
According to the conditional comment this is Internet Explorer 5.5<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is Internet Explorer 6<br />
<![endif]-->
</p>
e sada ja otkucam nešto kao
superskripta ccoment.html 5.5

i dobijem kao rezultat
Kôd:
<p>
According to the conditional comment this is Internet Explorer 5.5<br />
</p>
To bi mi dosta pomoglo u debagovanju, jer ima kodova koji koriste dosta tih conditional commenta pa se čovek malo pogubi šta se u kojoj verziji od koda stvarno ispisuje/interpretira.
Uz ovakav program mogao bih da vidim tačno šta koji browser stvarno "žvaće".

Hvala unapred!
duki je offline   Odgovorite uz citat