Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

IEºÍFirefoxÔÚJavaScriptÓ¦ÓÃÖеļæÈÝÐÔ

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Ö»ÄÜÔÚʼþ·¢ÉúµÄÏÖ³¡Ê¹ÓÃ.
½â¾ö·½·¨:
IE:
<input name="Button8_1" type="button" value="IE" onclick="javascript:gotoSubmit8_1()"/>
...
<script language="javascript">
function gotoSubmit8_1() {
...
alert(window.event); //use window.event
...
}
</script>
IE&Firefox:
<input name="Button8_2" type="button" value="IE" onclick="javascript:gotoSubmit8_2(event)"/>
...
<script language="javascript">
function gotoSubmit8_2(evt) {


Ïà¹ØÎĵµ£º

ÒÔ°ÑjavaScriptǶÈëµ½swfÀïÁË


[ÐÂÎÅ×ÊѶ] ¿ÉÒÔ°ÑjavaScriptǶÈëµ½swfÀïÁË
×ÊѶÀàÐÍ: ·­Òë
À´Ô´Ò³Ãæ: http://www.kennybunch.com/blog/2009/09/embedding-javascript-into-a-swf/
×ÊѶԭ±êÌâ: Embedding JavaScript into a SWF
×ÊѶԭ×÷Õß: Kenny Bunch
flex ¿ª·¢ÕßÓ¦¸Ã¶ÔʹÓÃEmbedÔªÊý¾Ý±êǩǶÈë¸÷ÖÖ×ÊÔ´¶¼ºÜÊìϤÁË£¬ÏÖÔÚÔÚflash cs4ÖÐͬÑù¿ÉÒ ......

javascriptÕýÔò±í´ïʽ(ת)

Ò»£¬¸ÅÊö
1£¬ÕýÔò±í´ïʽ£¬¿ÉÒÔ˵ÊÇÈκÎÒ»ÖÖ±à³ÌÓïÑÔ¶¼ÌṩµÄ»úÖÆ£¬ËüÖ÷ÒªÊÇÌṩÁ˶Ô×Ö·û´®µÄ´¦ÀíÄÜÁ¦¡£
2£¬ÕýÔò±í´ïʽÔÚÒ³Ãæ´¦ÀíÖеÄʹÓó¡¾°£º
1£©±íµ¥ÑéÖ¤¡£Ñé֤ijЩÓò·ûºÏijÖÖ¹æÔò£¬ÀýÈçÓʼþÊäÈë¿ò±ØÐëÊäÈëµÄÊÇÓʼþ¡¢ÁªÏµµç»°ÊäÈë¿òÊäÈëµÄ±ØÐëÊÇÊý×ֵȵÈ
2£©´¦ÀíDOMÄ£ÐÍ¡£ÀýÈçͨ¹ý±í´ïʽ¶¨Î»DOMÖеÄÒ»¸ö¶ÔÏó»òһϵÁ ......

JavaScript»ù±¾ÔªËØ

1.Text µ¥Ðе¥ÁÐÊäÈëÔªËØ
          ¹¦ÄÜ£º¶ÔText±êʶÖеÄÔªËØʵʩÓÐЧµÄ¿ØÖÆ
          »ù±¾ÊôÐÔ£º
                Name£ºÉ趨Ìá½»ÐÅÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ