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

javascript±¸Íü

1.ÀûÓà document.location.href="/index.html" ¼ÒÔÚÒ»¸öÒ³Ãæ
2.ÀûÓÃthrow²¶»ñÒì³£
try
{
if(x>10)
  throw "Err1"
}
catch(er)
{
if(er=="Err1")
}
3.ʹÓ÷´Ð±¸Ü¶Ô´úÂë½øÐÐÕÛÐУº
document.write("Hello \
World!")
4.match() ·½·¨
ÈçºÎʹÓà match() À´²éÕÒ×Ö·û´®ÖÐÌض¨µÄ×Ö·û£¬²¢ÇÒÈç¹ûÕÒµ½µÄ»°£¬Ôò·µ»ØÕâ¸ö×Ö·û


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

Javascript »ñÈ¡Á´½Ó(url)²ÎÊýµÄ·½·¨

 ×÷Õß:
YITU.org    
À´Ô´:
YITU.org    

ʱ¼ä:
2007-02-26 10:34:58

ÓÐʱÎÒÃÇÐèÒªÔÚ¿Í»§¶Ë»ñÈ¡Á´½Ó²ÎÊý£¬Ò»¸ö³£¼ûµÄ·½·¨Êǽ«Á´½Óµ±×ö×Ö·û´®£¬°´ÕÕÁ´½ÓµÄ¸ñʽ·Ö½â£¬È»ºó»ñÈ¡¶ÔÓ¦µÄ²ÎÊýÖµ¡£±¾Îĸø³öµÄ¾ÍÊÇÕâ¸öÁ÷³ÌµÄ¾ßÌåʵÏÖ·½·¨¡£
µ±È»£¬ ......

JavaScriptÖÐnull, undefined µÄÉîÈë̽ÌÖ

 null, undefined
Ïàͬ£º
µ±Ò»¸ö±äÁ¿µÄÖµÊÇnull, undefinedʱ£¬±íʾ£ºÎÒÃÇÉùÃ÷²¢¶¨ÒåÁËÒ»¸ö±äÁ¿£¬½ö½öÊÇÕâ¸ö±äÁ¿µÄÖµÊÇnull, undefined.
±»µ÷ÓÃÕߣº
½«null, undefined×÷Ϊ²ÎÊý´«Èë"JavaScriptÄÚÖú¯Êý"ʱ£¬²»»á³öÏÖÒì³££¬ÄÚÖú¯Êý·µ»Ø£ºnull -> null,  undefined->undefined
µ«typeofº¯Êý³ýÍâ¡£
µ÷ ......

javascript½âÎöXML

 Ê×ÏÈ´´½¨½âÎö¶ÔÏó£º
try
{
xmldoc=new ActiveXObject("Microsoft.XMLDOM");//IE
}catch(e)
{
try{
xmldoc=document.implementation.createDocument("","",null);//·ÇIE
}catch(e)
{
alert("ÎÞ·¨´´½¨¶ÔÏó£¡");
return;
}
}
xmldoc.async="false";
xmldoc.load(" ......

javascriptÖеÄtest·½·¨

¶¨ÒåºÍÓ÷¨
test() ·½·¨ÓÃÓÚ¼ì²âÒ»¸ö×Ö·û´®ÊÇ·ñÆ¥Åäij¸öģʽ.
Óï·¨
RegExpObject.test(string)
²ÎÊýÃèÊö
string
±ØÐè¡£Òª¼ì²âµÄ×Ö·û´®¡£
·µ»ØÖµ
Èç¹û×Ö·û´® string Öк¬ÓÐÓë RegExpObject Æ¥ÅäµÄÎı¾£¬Ôò·µ»Ø true£¬·ñÔò·µ»Ø false¡£
˵Ã÷
µ÷Óà RegExp ¶ÔÏó r µÄ test() ·½·¨£¬²¢ÎªËü´«µÝ×Ö·û´® s£¬ÓëÕâ¸ö±íÊ¾Ê½Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ