IEºÍFirefoxÔÚcss,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) {
...
evt=evt?evt:(window.event?window.
Ïà¹ØÎĵµ£º
var Tid;
var SetTime=4*60*60*1000; //ÉèÖúÁÃëÊý£¬1000ºÁÃëΪ1Ãë
function LTime(){
var MyDiv=document.getElementById("mydiv");
var Time,TempTime,Days,Hours,Minutes,Seconds;
&n ......
jsÑéÖ¤±íµ¥´óÈ«
1. ³¤¶ÈÏÞÖÆ
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("²»Äܳ¬¹ý50¸ö×Ö·û£¡");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"&g ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TAO BAO TEST 2&l ......
ÔÚÐÂÔöÊý¾ÝÏîµÄʱºò£¬ÓÃajaxʵÏÖÎÞË¢ÐÂÌá½»£¬µ«ÉÏ´«ÎļþµÄʱºò£¬ÓÉÓÚÊý¾ÝÀàÐÍÔÒò£¬²»Äܽ«Ò³ÃæµÄ<asp:FileUpload>ÖÐÒÔ×Ö·û´®ÖµµÄ·½Ê½´«µ½jsÀïµ÷Óá£ÎÒÒ»¹²ÕÒµ½ÁËÁ½¸ö·½·¨ÓèÒÔ½â¾ö£¬ÊµÏÖÎÞË¢ÐÂÉÏ´«¡£
µÚÒ»ÖÖ·½·¨£ºÀûÓÃjsµÄADODB.Stream£¬½«ÎļþÏÈת»»³ÉÁ÷£¬ÔÙͨ¹ýjsÉÏ´«µ½·þÎñÆ÷£¬ÕâÑùÓиöºÃ´¦¾ÍÊÇ¿ÉÒÔÉÏ´«³¬´óÎļþ£ ......