IEºÍFirefoxÖ®¼äµÄJavaScript²îÒì
¾¡¹Ü JavaScript ÀúÊ·ÉÏʹÓÃÈß³¤¶øÁîÈËÉúÑáµÄ´úÂë¿éÀ´±êµÄÌض¨ä¯ÀÀÆ÷µÄʱÆÚÒѾ½áÊøÁË£¬µ«ÊÇż¶ûʹÓÃһЩ¼òµ¥µÄ´úÂë¿éºÍ¶ÔÏó¼ì²âÀ´È·±£Ò»Ð©´úÂëÔÚÓû§»úÆ÷ÉÏÕý³£¹¤×÷ÒÀÈ»ÊDZØÒªµÄ¡£
ÕâƪÎÄÕÂÖУ¬ÎÒ»áÂÔÊöһϠInternet Explorer ºÍ Firefox ÔÚ JavaScript Óï·¨Éϲ»Í¬µÄ¼¸ ¸ö·½Ãæ¡£
1. CSS “float” ÊôÐÔ
»ñÈ¡¸ø¶¨¶ÔÏóµÄÌض¨ CSS ÊôÐԵĻù±¾Óï·¨ÊÇ object.style ÊôÐÔ£¬¶øÇÒÓÐÁ¬×Ö·ûµÄÊôÐÔÒªÓÃÂæÍÕÃüÃû·¨À´´úÌæ¡£ÀýÈ磬»ñÈ¡Ò»¸ö ID Ϊ “header” µÄ div µÄ background-color ÊôÐÔ£¬ÎÒÃÇÒªÓÃÈçÏÂÓï·¨£º
document.getElementById("header").style.borderBottom= "1px solid #ccc";
µ«ÊÇÓÉÓÚ “float” ÊÇ JavaScript µÄ±£Áô´Ê£¬ÎÒÃǾÍÎÞ·¨Ê¹Óà object.style.float À´»ñÈ¡ “float” ÊôÐÔÁË¡£Ò»ÏÂÊÇÎÒÃÇÔÚÁ½ÖÖä¯ÀÀÆ÷ÖеÄʹÓõķ½·¨£º
IE Óï·¨£º
document.getElementById("header").style.styleFloat = "left";
Firefox Óï·¨£º
document.getElementById("header").style.cssFloat = "left";
2. ÔªËصļÆËãÑùʽ
ͨ¹ýʹÓÃÉÏÊöµÄ object.style.property£¬ JavaScript ¿ÉÒÔºÜÈÝÒ׵ĻñÈ¡ºÍÐ޸ĶÔÏóµÄÉ趨 CSS Ñùʽ¡£µ«ÊÇÕâÒ»Óï·¨µÄ¾ÖÏÞÔÚÓÚ£¬ËüÖ»ÄÜÈ¡µÃÄÚÁªÔÚ HTML ÀïµÄÑùʽ£¬»òÕßÖ±½ÓʹÓà JavaScript É趨µÄÑùʽ¡£style ¶ÔÏó²»ÄÜ»ñȡʹÓÃÍⲿÑùʽ±íÉ趨µÄÑùʽ¡£ÎªÁË»ñÈ¡¶ÔÏóµÄ”¼ÆËãÑùʽ”£¬ÎÒÃÇʹÓÃÒÔÏ´úÂ룺
IE Óï·¨£º
var myObject = document.getElementById("header");
var myStyle = myObject.currentStyle.backgroundColor;
Firefox Óï·¨£º
var myObject = document.getElementById("header");
var myComputedStyle = document.defaultView.getComputedStyle(myObject, null);
var myStyle = myComputedStyle.backgroundColor;
3. »ñÈ¡ÔªËصĔclass”ÊôÐÔ
ÀàËÆÓÚ”float”ÊôÐÔµÄÇé¿ö£¬ÕâÁ½ÖÖä¯ÀÀÆ÷ʹÓò»Í¬µÄ JavaScript ·½·¨À´»ñÈ¡Õâ¸öÊôÐÔ¡£
IE Óï·¨£º
var myObject = document.getElementById("header");
var myAttribute = myObject.getAttribute("className");
&nb
Ïà¹ØÎĵµ£º
ͨ³£ÓÃtypeofÀ´ÅжÏjs±äÁ¿µÄÀàÐÍ£¬µ«ºÜ¶àʱºò½ö½ötypeofÂú×ã²»ÁËÒªÇóµÄ¡£
ÎÒдÁËÒ»¸ö×Ô¶¨Ò庯ÊýÀ´×öÕâ¸öÊ£¬ÅжϵıȽÏÈ«ÃæÁË¡£
New
function
varType(v){
if
(
typeof
v===
"object"
){
if
(v===
null
)
return
'null'
;
if
(v.
constructo ......
ת×Ô£ºhttp://www.cnblogs.com/mslove/
ÃèÊö
event´ú±íʼþµÄ״̬£¬ÀýÈç´¥·¢event¶ÔÏóµÄÔªËØ¡¢Êó±êµÄλÖü°×´Ì¬¡¢°´ÏµļüµÈµÈ¡£
event¶ÔÏóÖ»ÔÚʼþ·¢ÉúµÄ¹ý³ÌÖвÅÓÐЧ¡£
eventµÄijЩÊôÐÔÖ»¶ÔÌض¨µÄʼþÓÐÒâÒå¡£±ÈÈ磬fromElement ºÍ toElement ÊôÐÔÖ»¶Ô onmouseover ºÍ onmouseout ʼþÓÐÒâÒå¡£
Àý×Ó
ÏÂÃæµÄÀý×Ó¼ì²é ......
ʹÓùýajaxµÄ¶¼³£¼ûÕâÑùµÄ´úÂ룺
<a href="javascript:doTest2();void(0);" mce_href="javascript:doTest2();void(0);">here</a>
µ«Õâ¶ùµÄvoid(0)¾¿¾¹ÊǺκ¬ÒåÄØ£¿
JavascriptÖÐvoidÊÇÒ»¸ö²Ù×÷·û£¬¸Ã²Ù×÷·ûÖ¸¶¨Òª¼ÆËãÒ»¸ö±í´ïʽµ«ÊDz»·µ»ØÖµ¡£
void ²Ù×÷·ûÓ÷¨¸ñʽÈçÏ£º
1. javascript:void (expres ......
<a class="bt_3" href="javascript:void(0)" mce_href="javascript:void(0)" id="btnSubmit1" onclick="submitPage()">Ìá½»</a>
submitPage() ÊÇÎÒ¶¨ÒåµÄÒ»¸öº¯Êý£¬ÔÒâÊǵã»÷Õâ¸ö<a>ʱ£¬Ìá½»Ò»¸ö±íµ¥¡£ft, ie6 ¾ÓÈ»²»¿ÉÒÔ£¬ÔõôҲ²»ÄÜÌá½»¡£
¿´À´ÊÇÒòΪ ie6 Ö´ÐÐĬÈ϶¯×÷ÒýÆðÀ´£¬Ä¿Ç°Á½ÖÖ½â¾ö·½·¨£ ......
½ñÌìÔÚ×öÒ»¸öѧÉúÐÅÏ¢ÐÞ¸ÄÒ³ÃæµÄʱºòÓöµ½ÁËÒ»µãСÎÊÌ⣬ÒòÐèÇóÖ¸³öѧÉúÔڲ鿴¸öÈËÐÅϢʱ¿ÉÒÔÉê¸æÆäÖеĴíÎóÐÅÏ¢£¬²¢Ìá½»ÕýÈ·ÐÅÏ¢£¬ËùÒÔÎÒÔÚÏÔʾ»ù±¾ÐÅÏ¢µÄʱºò¶ÔÓÚѧԺ¡¢×¨ÒµºÍ°à¼¶µÈ¾Í²ÉÓÃÁËÏÂÀ²Ëµ¥£¬ÎªÁËʹÏÂÀ²Ëµ¥ÏÔʾѧÉúµ±Ç°µÄÐÅÏ¢£¬ÇÒ¾ßÓÐÁª¶¯Ð§¹ûÐèÔÚjsÖлñÈ¡sessionÖд«¹ýÀ´µÄÏà ......