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º¯Êý)
Ïà¹ØÎĵµ£º
http://blog.csdn.net/cyai/archive/2009/05/25/4213956.aspx
JS×Ô´øº¯Êý
concat
½«Á½¸ö»ò¶à¸ö×Ö·ûµÄÎı¾×éºÏÆðÀ´£¬·µ»ØÒ»¸öеÄ×Ö·û´®¡£
var a = "hello";
var b = ",world";
var c = a.concat(b);
alert(c);
//c = "hello,world"
indexOf
·µ»Ø×Ö·û´®ÖÐÒ»¸ö×Ó´®µÚÒ»´¦³öÏÖµÄË÷Òý£¨´Ó×óµ½ÓÒËÑË÷£©¡£Èç¹ûÃ»Ó ......
×î½ü·¢ÏÖDOMDocument¶ÔÏóºÜÖØÒª,»¹ÓÐXMLHTTPÒ²ºÜÖØÒª
×¢Òâ´óСдһ¶¨²»ÄÜŪ´í.
ÊôÐÔ:
1Attributes ´æ´¢½ÚµãµÄÊôÐÔÁбí(Ö»¶Á)
2childNodes ´æ´¢½ÚµãµÄ×Ó½ÚµãÁбí(Ö»¶Á)
3dataType ·µ»Ø´Ë½ÚµãµÄÊý¾ÝÀàÐÍ
4Definition ÒÔDTD»òXMLģʽ¸ø³öµÄ½ÚµãµÄ¶¨Òå(Ö»¶Á)
5Doctype Ö¸¶¨ÎĵµÀàÐͽڵã(Ö»¶Á)
6documentE ......
javascriptµÄparseIntº¯Êý
javascriptµÄparseIntº¯Êý£¬´ó¼Ò¶¼ÖªµÀÊǸÉɶµÄ
µ«ÄãÖªµÀ
parseInt("07") ·µ»Ø¶àÉÙ ?
parseInt("08") ÓÖ·µ»Ø¶àÉÙ ?
ÕýÈ·´ð°¸ÊÇ
parseInt("07") ·µ»Ø8
parseInt("08") ·µ»Ø0
ÄãÖªµÀÎÊÌâÔÚÄÄ£¿
Æäʵ£¬Õâ¸öÎÊÌâ¿ÉÄÜ´ó¼Ò¶¼Ã»Ïë¹ý°É¡£
ÓÃjavascriptµÄparseIntº¯Êýʱ£¬
parseInt("08") ......
Ê×ÏÈ´´½¨½âÎö¶ÔÏó£º
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(" ......