firefoxÓëIE¶ÔjavascriptºÍCSSµÄÇø±ð
1. document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements["elementName"];
FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃ()»ò[]»ñÈ¡¼¯ºÏÀà¶ÔÏó;FirefoxÏÂ,Ö»ÄÜʹÓÃ[]»ñÈ¡¼¯ºÏÀà¶ÔÏó.
½â¾ö·½·¨:ͳһʹÓÃ[]»ñÈ¡¼¯ºÏÀà¶ÔÏó.
3.×Ô¶¨ÒåÊôÐÔÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓûñÈ¡³£¹æÊôÐԵķ½·¨À´»ñÈ¡×Ô¶¨ÒåÊôÐÔ,Ò²¿ÉÒÔʹÓÃgetAttribute()»ñÈ¡×Ô¶¨ÒåÊôÐÔ;FirefoxÏÂ,Ö»ÄÜʹÓÃgetAttribute()»ñÈ¡×Ô¶¨ÒåÊôÐÔ.
½â¾ö·½·¨:ͳһͨ¹ýgetAttribute()»ñÈ¡×Ô¶¨ÒåÊôÐÔ.
4.eval("idName")ÎÊÌâ
˵Ã÷:IEÏÂ,,¿ÉÒÔʹÓÃeval("idName")»ògetElementById("idName")À´È¡µÃidΪidNameµÄHTML¶ÔÏó;FirefoxÏÂÖ»ÄÜʹÓÃgetElementById("idName")À´È¡µÃidΪidNameµÄHTML¶ÔÏó.
½â¾ö·½·¨:ͳһÓÃgetElementById("idName")À´È¡µÃidΪidNameµÄHTML¶ÔÏó.
5.±äÁ¿ÃûÓëijHTML¶ÔÏóIDÏàͬµÄÎÊÌâ
˵Ã÷:IEÏÂ,HTML¶ÔÏóµÄID¿ÉÒÔ×÷ΪdocumentµÄÏÂÊô¶ÔÏó±äÁ¿ÃûÖ±½ÓʹÓÃ;FirefoxÏÂÔò²»ÄÜ.FirefoxÏÂ,¿ÉÒÔʹÓÃÓëHTML¶ÔÏóIDÏàͬµÄ±äÁ¿Ãû;IEÏÂÔò²»ÄÜ¡£
½â¾ö·½·¨:ʹÓÃdocument.getElementById("idName")´úÌædocument.idName.×îºÃ²»ÒªÈ¡HTML¶ÔÏóIDÏàͬµÄ±äÁ¿Ãû,ÒÔ¼õÉÙ´íÎó;ÔÚÉùÃ÷±äÁ¿Ê±,Ò»ÂɼÓÉÏvar,ÒÔ±ÜÃâÆçÒå.
6.constÎÊÌâ
˵Ã÷:FirefoxÏÂ,¿ÉÒÔʹÓÃconst¹Ø¼ü×Ö»òvar¹Ø¼ü×ÖÀ´¶¨Òå³£Á¿;IEÏÂ,Ö»ÄÜʹÓÃvar¹Ø¼ü×ÖÀ´¶¨Òå³£Á¿.
½â¾ö·½·¨:ͳһʹÓÃvar¹Ø¼ü×ÖÀ´¶¨Òå³£Á¿.
7.input.typeÊôÐÔÎÊÌâ
˵Ã÷:IEÏÂinput.typeÊôÐÔΪֻ¶Á;µ«ÊÇFirefoxÏÂinput.typeÊôÐÔΪ¶Áд.
8.window.eventÎÊÌâ
˵Ã÷:window.eventÖ»ÄÜÔÚIEÏÂÔËÐÐ,¶ø²»ÄÜÔÚFirefoxÏÂÔËÐÐ,ÕâÊÇÒòΪFirefoxµÄeventÖ»ÄÜÔÚʼþ·¢ÉúµÄÏÖ³¡Ê¹ÓÃ. Firefox±ØÐë´ÓÔ´´¦¼ÓÈëevent×÷²ÎÊý´«µÝ¡£IeºöÂԸòÎÊý£¬ÓÃwindow.eventÀ´¶ÁÈ¡¸Ãevent¡£
½â¾ö·½·¨:
IE&Firefox:
Submitted(event)"/> …
<script language="javascript">
function Submitted(evt) {
evt=evt?evt:(window.event?window.event:null);
}
</script>
9.event.xÓëevent.yÎÊÌâ
˵Ã÷:IEÏÂ,even¶ÔÏóÓÐx,yÊôÐÔ,µ«ÊÇûÓÐpageX,pageYÊôÐÔ;FirefoxÏÂ,even¶ÔÏóÓÐpageX,pageYÊôÐÔ,µ«ÊÇûÓÐx,yÊôÐÔ.
½â¾ö·½·¨:ʹÓÃmX(mX = event.x ? event.x : e
Ïà¹ØÎĵµ£º
CSS ºÐÄ£ÐÍ
¡¡¡¡ÍøÒ³Éè¼ÆÖеÄÿ¸öÔªËض¼Êdz¤·½ÐεĺÐ×Ó¡£ºÐ×ӵijߴçÊÇÔõÑù¾«È·¼ÆËãµÄ£¬Çë¿´ÏÂͼ£º
¡¡¡¡
¡¡¡¡Èç¹ûÊÇ Firebug Óû§µÄ»°(»ù±¾ºÍÇ°¶ËÓйصĶ¼»áÓõ½ Firebug °É – ÌÇ°éÎ÷ºìÊÁ)£¬¾Í»áºÜÊìϤÏÂÃæµÄͼ±íÁË¡£
¡¡¡¡Õâ¸öͼ±íºÜºÃµØչʾÁË×÷ÓÃÓÚÒ³ÃæÉÏÈÎÒâºÐ×ÓµÄÊýÖµ¡£
¡¡¡¡
¡¡¡¡×¢ÒâÒÔÉÏÁ½¸öÀý×ÓÖУ¬margi ......
//ÏÔʾµ±Ç°Ê±¼ä----------------------------------------------------------
<SCRIPT language="javascript" type="text/javascript" >
function reloop(){
var time = new Date( ); //»ñµÃµ±Ç°Ê±¼ä
//»ñµÃÄê¡¢Ô¡¢ÈÕ£¬Date()º¯ÊýÖеÄÔ·ÝÊÇ´Ó0£11¼ÆËã
var year = time.getFullYear ......
1.ÔÚHTMLÖÐʹÓÃ<script>ÔªËØÒýÈëJavaScript¡£
¸ÃÔªËØÓÐÁ½¸öÊôÐÔ£¬languageÉùÃ÷ҪʹÓõĽű¾ÓïÑÔ£¬srcÊôÐÔÊÇ¿ÉÑ¡µÄ£¬ÓÃÓÚÒýÓÃÍⲿJavaScriptÎļþ¡£
NB
£ºÏÖÔÚ´ó¶àʹÓÃtypeÊôÐÔ£¨type=“text/javascript”£©Ìæ´úlanguageÊôÐÔ£¬ÒÔ±ã¸üºÃµØÖ§³ÖXHTML£¨¿ÉÀ©Õ¹HTML£©¡£
2.Ò»°ãÈÏΪ ......
text-overflow : ellipsis;
white-space : nowrap;
overflow : hidden;
½âÊÍһϣº
text-overflow £ºellipsis; //ÈýضϵÄÎÄ×ÖÏÔʾΪµãµã¡£»¹ÓÐÒ»¸öÖµÊÇclipÒâ˼Êǽضϲ»ÏÔʾµãµã
white-space : nowrap; //ÈÃÎÄ×Ö²»»»ÐÐ
overflow : hidden; //³¬³öÒªÒþ²Ø
ÒªÏÔʾΪµãµã£¬3¸öȱһ²»¿É£¬»¹ÓУ¬³ýÁËfirefox,operaÆäËûä¯ ......
ÔÚд¡¶ÎÒÈçºÎ¿´´ýDIV+CSS¡·µÄʱºò
ÎÒÏëµ½£º
´úÂëûÓÐÐÐÓë²»Ðеķֱð
¶øÖ»ÓкÃÓë²»ºÃµÄ²î¾à
ºÃÓë²»ºÃ¶¼ÄÜÍê³ÉÏàÓ¦µÄ¹¦ÄÜ
Ò»¸ö¹¦ÄÜÉÙÁËÄÜд£¬¶àÁËÒ²ÄÜд
±à³ÌÓïÑÔ¾ÍÄÇô¼¸¸ö¹Ø¼ü×Ö¡¢ÄÇô¼¸Ìõ¿ØÖÆÓï¾ä
ËäÈ»¿ò¼Ü»òÀà¿âµÄÀàºÜ¶à
µ«Ò²²»ÊÇû¸öÊýµÄ
¿ÉÊÇÄÇЩ¼ÆËã»ú´óʦÃÇ°¡
È´ÄÜд³öÈÃÈ˾õµÃ“ÃÀ”µÄ´úÂë
ÎªÊ ......