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

JavascriptÔÚIEºÍFireFoxÖеIJ»Í¬±íÏÖ


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,ÒÔ±ÜÃâÆçÒå.
7.input.typeÊôÐÔÎÊÌâ
˵Ã÷:IEÏÂinput.typeÊôÐÔΪֻ¶Á;µ«ÊÇFirefoxÏÂinput.typeÊôÐÔΪ¶Áд.
9.event.xÓëevent.yÎÊÌâ
˵Ã÷:IEÏÂ,even¶ÔÏóÓÐx,yÊôÐÔ,µ«ÊÇûÓÐpageX,pageYÊôÐÔ;FirefoxÏÂ,even¶ÔÏóÓÐpageX,pageYÊôÐÔ,µ«ÊÇûÓÐx,yÊôÐÔ. 
½â¾ö·½·¨:ʹÓÃmX(mX = event.x ? event.x : event.pageX;)À´´úÌæIEϵÄevent.x»òÕßFirefoxϵÄevent.pageX.
10.event.srcElementÎÊÌâ
˵Ã÷:IEÏÂ,event¶ÔÏóÓÐsrcElementÊôÐÔ,µ«ÊÇûÓÐtargetÊôÐÔ;FirefoxÏÂ,event¶ÔÏóÓÐtargetÊôÐÔ,µ«ÊÇûÓÐsrcElementÊôÐÔ. 
½â¾ö·½·¨:ʹÓÃobj(obj = event.srcElement ? event.srcElement : event.target;)À´´úÌæIEϵÄevent.srcElement»òÕßFirefoxϵÄevent.target.
13.frameÎÊÌâ
ÒÔÏÂÃæµÄframeΪÀý£º
<frame src="xxx.html" id="frameId" name="frameName" />
(1)·ÃÎÊframe¶ÔÏó:
IE:ʹÓÃwindow.frameId»òÕßwindow.frameNameÀ´·ÃÎÊÕâ¸öframe¶ÔÏó.
Firefox:Ö»ÄÜʹÓÃwindow.frameNa


Ïà¹ØÎĵµ£º

javascript µÄ±Õ°ü

±Õ°ü£¨closure£©ÊÇJavascriptÓïÑÔµÄÒ»¸öÄѵ㣬ҲÊÇËüµÄÌØÉ«£¬ºÜ¶à¸ß¼¶Ó¦Óö¼ÒªÒÀ¿¿±Õ°üʵÏÖ¡£
ÏÂÃæ¾ÍÊÇÎÒµÄѧϰ±Ê¼Ç£¬¶ÔÓÚJavascript³õѧÕßÓ¦¸ÃÊǺÜÓÐÓõġ£
Ò»¡¢±äÁ¿µÄ×÷ÓÃÓò
ÒªÀí½â±Õ°ü£¬Ê×ÏȱØÐëÀí½âJavascriptÌØÊâµÄ±äÁ¿×÷ÓÃÓò¡£
±äÁ¿µÄ×÷ÓÃÓòÎ޷ǾÍÊÇÁ½ÖÖ£ºÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿¡£
JavascriptÓïÑÔµÄÌØÊâÖ®´¦£¬¾ÍÔÚÓ ......

javascript, json, xml

¡¾×ª×Ô¡¿http://www.cnblogs.com/chenxizhang/archive/2010/01/13/1646255.html
ÔÚÍøÂç±à³ÌÖУ¬ÎÒÃǾ­³£ÐèÒªÓõ½javascript,ÕâЩ¿Í»§¶Ë½Å±¾ÓÖ¾­³£ÐèÒªÓë·þÎñ¶Ë½øÐÐÒì²½µÄͨѶ£¬Ìá½»²¢½ÓÊÕÊý¾Ý¡£ÏÂÃæÕâ¸öÀý×ÓÑÝʾÁËÈçºÎÉè¼Æ·þÎñ£¬ÈçºÎ±àд½Å±¾
1. ·þÎñ¶Ë£¬ÕâÊÇÒ»¸öashxÎļþ
ÐèÒªÌí¼ÓÁ½¸öÒýÓà System.Runtime.Serializatio ......

ÈçºÎÔÚjavascriptÖзÃÎÊÒ³Ã涨ÒåµÄ±äÁ¿

¡¾×ª¡¿http://www.cnblogs.com/chenxizhang/archive/2010/01/01/1637309.html
Èç¹ûÎÒÃÇÐèÒªÔÚjavascript·ÃÎʵ½Ò³ÃæÖж¨ÒåµÄ±äÁ¿£¬´óÖÂÊÇÈçϵÄÓï·¨
//ÕâÊÇ2010Äê1ÔÂ1ÈÕÔö¼ÓµÄ´úÂë
var ismanager = "<%= DepartManager %>";
if (ismanager == "true") {
$(" ......

Javascript StringÀàµÄÊôÐÔ¼°·½·¨[ת]

ÒÔÏÂÊÇjavaScriptÖеÄStringʹÓ÷½·¨£º
String Àà Attribute and method
anchor()              ´´½¨Ò»¸ö<a>±êÇ©µÄʵÀý£¬½«ÆänameÊôÐÔÉèÖÃΪ±»´«µÝ¸ø´Ë·½·¨µÄ×Ö·û´®
big()           & ......

frameµÄʹÓá¡ÒÔ¼°javascript¶ÔÆäµÄ²Ù×÷

FRAMESET ±êÇ©ÊÇ FRAME ÔªËصÄÈÝÆ÷¡£
HTML Îĵµ¿É°üº¬ FRAMESET ÔªËØ»ò BODY ÔªËØÖ®Ò»£¬Á½Õß²»ÄÜͬʱʹÓá£
¿ò¼Ü½«ÍøÒ³·Ö³É¼¸¸ö¿ò´°£¬Í¬Ê±È¡µÃ¶à¸öURL¡£ÓÃ<FRAMESET> <FRAME> ¼´¿É£¬ËùÓпò¼Ü±ê¼ÇÐèÒª·ÅÔÚÒ»¸ö×ÜÆðµÄ html ÎĵµÀÕâ¸öµµ°¸Ö»¼Ç¼Á˸ÿò¼ÜÈçºÎ·Ö¸î £¬²»»áÏÔʾÈκÎ×ÊÁÏ£¬ËùÒÔ²»±Ø·ÅÈë <BODY& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ