JavaScript×Ö·û´®ÖеÄ×Ö·ûÊý×é
Ô´³ÌÐò£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScript×Ö·û´®ÖеÄ×Ö·ûÊý×é</title>
</head>
<body>
<script type="text/javascript">
var str = "www.dreamdu.com";
document.write(str+"µÄµÚÎå¸ö×ÖĸÊÇ"+str);
document.write("<br />");
document.write(str+" = "+str[0]+str[1]+str[2]+str[3]+str[4]+str[5]+str[6]+str[7]+str[8]+str[9]+str[10]+str[11]+str[12]+str[13]+str[14]);
</script>
</body>
</html>
Êä³ö½á¹û£º
www.dreamdu.comµÄµÚÎå¸ö×ÖĸÊÇundefined
www.dreamdu.com = undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined
×¢Ò⣺
1¡¢JavaScript×Ö·û´®ÖеÄÿ¸öÖµ¿ÉÒÔʹÓÃ×Ö·ûÊý×éµÄ·½Ê½·ÃÎÊ£¬×¢Òâ×Ö·û´®Êý×éµÄË÷ÒýÊÇ´Ó0¿ªÊ¼µÄ¡£¿ÉÒÔʹÓÃcharAt()º¯Êý´úÌæÊý×éË÷Òý·½Ê½¡£(IE²»Ö§³Ö×Ö·ûÊý×飬ÇëʹÓÃcharAtº¯Êý)
Ïà¹ØÎĵµ£º
//ÓÉÒ³ÃæÔªËØdate_string(YYYY-MM_DD¸ñʽ)µÃµ½Êý×édate_array
//ÊäÈë²ÎÊý£ºdate_string:ÈÕÆÚ´®£»marker:ÈÕÆÚ´®date_stringÀïµÄ·Ö¸ô·û£¬Èç¹ûûÓÐÔòΪ""£»
//·µ»ØÖµ£º Êý×飺date_array
// Êý×éÔªËØdate_array.year=YYYY£»dat ......
ÆäËüÃæÏò¶ÔÏóµÄÓïÑÔÈçJAVAµÄÒ»¸ö³£¼ûÌØÐÔÊÇ£¬¸ù¾Ý´«ÈëµÄ²»Í¬ÊýÁ¿»òÀàÐ͵ģ¬Í¨¹ýÖØÔØ(overload) À´·¢»Ó²»Í¬µÄ¹¦Ó᣾¡¹ÜÕâ¸öÌØÐÔÔÚJavaScriptÖв¢Ã»ÓÐÖ±½ÓÖ§³Ö£¬Ò²Óкܶà°ì·¨Äܹ»ÊµÏÖ¡£
º¯ÊýÖØÔØ£¨function overloading£©±ØÐëÒÀÀµÁ½¼þÊÂÇ飺Åжϴ«Èë²ÎÊýµÄÊýÁ¿µÄÄÜÁ¦ºÍÅжϴ«Èë²ÎÊýÀàÐ͵ÄÄÜÁ¦¡£
JavaScript掅 ......
½ñÌìС±àºÍ´ó¼Ò̽ÌÖµÄÊÇJavaScriptÖÐ×Ô¶¨Ò庯ÊýµÄÓ÷¨£¬ÏÂÃæÊ¾ÀýÖÐµÄ Checktriplet º¯ÊýÒÔÈý½ÇÐεı߳¤Îª²ÎÊý¡£Í¨¹ý²é¿´ÈýÌõ±ßµÄ³¤¶ÈÊÇ·ñ¿ÉÒÔ×é³ÉÒ»¸ö±Ï´ï¸çÀ˹ÈýÔª×飨ֱ½ÇÈý½ÇÐÎб±ß³¤¶ÈµÄƽ·½µÈÓÚÆäËûÁ½Ìõ±ß³¤µÄƽ·½ºÍ£©À´¼ÆËã¸ÃÈý½ÇÐÎÊÇ·ñΪֱ½ÇÈý½ÇÐΡ£Êµ¼Ê²âÊÔʱ checkTriplet º¯ÊýÒªµ÷ÓÃÁíÁ½¸öº¯ÊýÖеÄÒ»¸öº¯Êý¡£
......
×î½ü·¢ÏÖDOMDocument¶ÔÏóºÜÖØÒª,»¹ÓÐXMLHTTPÒ²ºÜÖØÒª
×¢Òâ´óСдһ¶¨²»ÄÜŪ´í.
ÊôÐÔ:
1Attributes ´æ´¢½ÚµãµÄÊôÐÔÁбí(Ö»¶Á)
2childNodes ´æ´¢½ÚµãµÄ×Ó½ÚµãÁбí(Ö»¶Á)
3dataType ·µ»Ø´Ë½ÚµãµÄÊý¾ÝÀàÐÍ
4Definition ÒÔDTD»òXMLģʽ¸ø³öµÄ½ÚµãµÄ¶¨Òå(Ö»¶Á)
5Doctype Ö¸¶¨ÎĵµÀàÐͽڵã( ......
Ê×ÏÈ´´½¨½âÎö¶ÔÏó£º
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(" ......