# Цікавий допис про те, як Mozilla XUL працює в Internet Explorer by Jean-Yves Cronier

<datetime class="hidden">2005-10-30T00:00</datetime>

<!-- category -- mostlylucidcouk, Imported -->
## 

Цікавий допис про те, як Mozilla XUL працює в Internet Explorer by Jean-Yves Cronier

в неділю, 12 вересня 2004 року, 11:46.

Нехай перехрещується далі! Jean-Yves Cronier left [коментар](/archive/2003/11/23/648.aspx) на моєму [старий допис про HTC всередині Mozilla](/archive/2003/11/23/648.aspx), він вказує на пост, який він залишив у [форум XULPlanet](http://xulplanet.com/forum/viewtopic.php?t=1038) показуючи техніку, щоб отримати [Поведінка XUL](http://xulplanet.com/tutorials/whyxul.html) запущено всередині Інтернет Explorer використовує просту поведінку HTC як шар інтерфейсу. Знову ж таки, це дуже круто - і, якщо ви зможете розширити її так, щоб забезпечити повний переклад між усіма поведінками IE HTC і їх еквівалентом XUL! У будь- якому разі, оскільки цю дію було розміщено на форумі, я не знаю ні про що не знаю, я повторю такий допис:

Я думав про можливості, запропоновані відомою поведінкою HTC до IE. Я думаю, що було б можливо інтерпретувати незначну частину специфікацій XUL.

Невеличкий зразок:

index.xul:

| <!----> |
| --- |
| **Код:** |
| &lt;? xml версії=" 1. 0 "encoding=" iso- 8859- 1"?&gt; <br>&lt;? xml- stylesheet type=" text/cs" href=" xul. css "media=" all"?&gt; <br>&lt;window id=" example- window " title=" Example" xmlns=" http: // www.mozilla. org/ keymaster/ gpageper/ therere.is. only. xul "&gt; <br>&lt;label control=" some- text " значення=" Виявіть якийсь текст" /&gt; <br>&lt;textbox id=" some- text " значення=" to " /&gt; <br>&lt;label control=" some- password " значення=" Виконайте пароль " /&gt; <br>&lt;textbox id=" some- password " type=" password" maxle=" 8 " /&gt; <br>&lt;menulist label=" Bus "&gt; <br>  &lt;menupopup&gt; <br>    &lt;menuitem label=" Car " /&gt; <br>    &lt;menuitem label=" Taxi " /&gt; <br>    &lt;menuitem label=" Bus " selected=" true " /&gt; <br>    &lt;menuitem label=" Train " /&gt; <br>  &lt;/ menupompup&gt; <br>&lt;/ menulist&gt; <br>&lt;/ window&gt; |

xul. css:

| <!----> |
| --- |
| **Код:** |
} {послідовність: адреса. htc)} <br>menuitem{ behavior: url}} {menuitem. htc)} <br>menulist{ behavior: url}} {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ >\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ > <br>menupopup{ behavior: purlmenupup.htc)} <br>textbox{ behavior: адреса_ textbox.htc)} <br>window{ behavior: hur=.htc)}}

label. htc:

| <!----> |
| --- |
| **Код:** |
| &lt;публічне: htc urn=" window "&gt; <br>&lt;public: attach подія=" on document prepared "proctor=" build" /&gt; <br>&lt;публічне: Неправильне ім' я=" значення " /&gt; <br>&lt;скрипт type=" text/ javascript "&gt; <br>function build} { this. WinnerHTML= this. value;} <br>&lt;/ script&gt; <br>&lt;/ public: htc&gt; |

menuitem. htc:

| <!----> |
| --- |
| **Код:** |
| &lt;публічне: htc urn=" window "&gt; <br>&lt;public: attach подія=" on document prepared "proctor=" build" /&gt; <br>&lt;публічне: Неправильне ім' я=" id " /&gt; <br>&lt;публічне: Неправильне ім' я=" label " /&gt; <br>&lt;публічне: Неправильне ім' я=" значення " /&gt; <br>&lt;скрипт type=" text/ javascript "&gt; <br>function build} { <br> var параметр = document. create Eloction} "кнопка "); <br> var style= this. currentStyle; <br> option. setAttribute} "id",id); <br> if} this. id!=null) {option. setAttribute} "id", this.id);} <br> if} this. value!=null) {option. setAttribute} " value," this. value);} <br> if} quot!=null) {option. WinnerHTML= label;} <br> у стилі ttyvar position) {option. style[probect]=style[probect];} <br> this. outerHTML=option. outerHTML; <br>} <br>&lt;/ script&gt; <br>&lt;/ public: htc&gt; |

menulist. htc:

| <!----> |
| --- |
| **Код:** |
| &lt;публічне: htc urn=" window "&gt; <br>&lt;public: attach подія=" on document prepared "proctor=" build" /&gt; <br>&lt;публічне: Неправильне ім' я=" id " /&gt; <br>&lt;скрипт type=" text/ javascript "&gt; <br>function build} { <br> var chooser = document. create Eloction} "select"; <br> var style= this. currentStyle; <br> select. setAttribute} "id "); <br> if}id!=null) { <br> select. setAttribute} "id ," this. id); <br> select. setAttribute} "name", this. id); <br>   } <br> chooser. WinnerHTML= this. WinnerHTML; <br> for}var position в стилі) { <br> select.style[probect]=style[progress]; <br>   } <br> select. style. width=" 100% "; <br> this. outerHTML=select. outerHTML; <br>} <br>&lt;/ script&gt; <br>&lt;/ public: htc&gt; |

menupopup. htc:

| <!----> |
| --- |
| **Код:** |
| &lt;публічне: htc urn=" window "&gt; <br>&lt;public: attach подія=" on document prepared "proctor=" build" /&gt; <br>&lt;публічне: Неправильне ім' я=" id " /&gt; <br>&lt;публічне: Неправильне ім' я=" label " /&gt; <br>&lt;публічне: Неправильне ім' я=" значення " /&gt; <br>&lt;скрипт type=" text/ javascript "&gt; <br>function build} { <br> var optgroup = document. createElComment} "opt group"; <br> var style= this. currentStyle; <br> if} this. id!=null) {optgroup. setAttribute} "id", this.id);} <br> if} this. label!=null) {optgroup. WinnerHTML= this. label;} <br> opt group. WinnerHTML= this. WinnerHTML; <br> у стилі }var application) {optgroup. style[probect]=style[probect];} <br> this. outerHTML=optgroup. outerHTML; <br>} <br>&lt;/ script&gt; <br>&lt;/ public: htc&gt; |

textbox. htc:

| <!----> |
| --- |
| **Код:** |
| &lt;публічне: htc urn=" window "&gt; <br>&lt;public: attach подія=" on document prepared "proctor=" build" /&gt; <br>&lt;публічне: Неправильне ім' я=" id " /&gt; <br>&lt;публічне: Неправильне ім' я=" значення " /&gt; <br>&lt;public: Неправильна назва=" type " /&gt; <br>&lt;публічне: Неправильне ім' я=" maxtension " /&gt; <br>&lt;скрипт type=" text/ javascript "&gt; <br>function build} { <br> var input = document. create Eloction} "input"); <br> var style= this. currentStyle; <br> input. setAttribute} "id"); <br> if}значення!=null) {input. setAttribute} "значення", значення);} <br> if}type!=null) {input. setAttribute} type", type);} <br> if} maxmaxlength!=null) {input. setAttribute} "maxlength", maxmaxlength);} <br> у стилі ttyvar application) {input. style[probect]=style[probect];} <br> input. style. width=" 100% "; <br> input. style. cursor=" text "; <br> input. style. borderStyle=" inset "; <br> input. style. borderColor=" ActiveBorder "; <br> input. style. borderWidth=" 2px "; <br> input. style. backgroundColor="# FFFFFF "; <br> input. style. padingLeft=" 2px "; <br> this. outerHTML=input. outerHTML; <br>} <br>&lt;/ script&gt; <br>&lt;/ public: htc&gt; |

window. htc:

| <!----> |
| --- |
| **Код:** |
| &lt;публічне: htc urn=" window "&gt; <br>&lt;public: attach подія=" on document prepared "proctor=" build" /&gt; <br>&lt;публічне: Неправильне ім' я=" title " /&gt; <br>&lt;скрипт type=" text/ javascript "&gt; <br>function build} { window. status= this. title;} <br>&lt;/ script&gt; <br>&lt;/ public: htc&gt; |

Забавно, да? ![Дуже щасливий](http://xulplanet.com/forum/images/smiles/icon_biggrin.gif)

Метою такого проекту не є підвищення якості Explorer Internet, але просто показати короткий огляд інших (які не мають Mozilla Web Brooker) технологій, доступних за допомогою Mozilla Framework