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) {
Ïà¹ØÎĵµ£º
html£º
<div id="slide-box">
<div id="slide">
<div id="fbshutter" style="width:1px;">
<img id="bPic" src="images/01.gif" /> </div>
  ......
<script language="javascript">
function IsDigit(cCheck)
{
return (('0'<=cCheck) && (cCheck<='9'));
}
function IsAlpha(cCheck)
{
return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))
}
function IsaNull(cCheck)
......
innerTextÊÇieµÄ˽ÓÐÊôÐÔ£¬firefoxµÄÀàËÆÊôÐÔΪtextContent£¬Èç¹ûÔÚÍøÒ³ÖÐʹÓÃinnerTextµÄ»°£¬ÐèÒªÓÃÒ»¸öÌõ¼þÅжÏÀ´²é¿´ä¯ÀÀÆ÷Ö§³ÖÄÄÖÖÊôÐÔ¡£ÕâÀïÎÒÃÇ¿ÉÒÔΪfirefox¶¨ÒåÒ»¸öinnerTextʹµÃÔÚÕýÎÄ´úÂëÖÐÖ»ÐèÒªÓÃinnerText¶ø·ÇÒ»¸öº¯Êý£¬¿Éʹ´úÂë±äµÃ¸üÖ±¹Û¼ò½à¡£
var lBrowser = {};
lBrowser.agt = navigator.userAgent.t ......
ÔÚUpdatepanelÖÐʹÓÃJAVASCRIPTµÄÎÊÌâ
ÔÚUpdatePanle×ÜʹÓÃjavascriptÈ磺Response.Write("<script language='javascript'>alert('" + error.Message.ToString() + "');history.back(-1);</script>"); ʱ£¬µ¯³öÀ´Ò»¸öÌáʾ¶Ô»°¿ò
Sys.WebForms.PageRequestManagerParserErrorException:
The message ......
1.Text µ¥Ðе¥ÁÐÊäÈëÔªËØ
¹¦ÄÜ£º¶ÔText±êʶÖеÄÔªËØʵʩÓÐЧµÄ¿ØÖÆ
»ù±¾ÊôÐÔ£º
Name£ºÉ趨Ìá½»ÐÅÏ ......