javascript¿´Ô´´úÂë
<HTML>
<HEAD>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>Óð´Å¥ÏÔʾԴ´úÂë»òÕßjavascriptÀïÃæµÄÄÚÈÝ£¬ÓÐʱ»áÓÐ</TITLE>
</HEAD>
<BODY >
<script id=abc >
function dennisboys()
{
var i=0;
alert(document.documentElement.childNodes[0].outerHTML)
}
</script>
<input type=button onclick=dennisboys() style="width:160" value=ÏÔʾheadÀïÃæµÄÄÚÈÝ>
<input type="button" value="ÏÔʾjavascriptÀïÃæ´úÂë" style="width:160" onclick="alert(document.all.abc.innerHTML)">
</BODY></HTML>
Ïà¹ØÎĵµ£º
ѧÓÃJS£¨javascript£©Óï¾ä´óÈ«¡£¶Ô³õѧÕߺÜÓаïÖú ¡£ÏÖÔÚÕûÀí³öÀ´£¬Ï£ÍûÄÜ°ïÖú´ó¼Ò¡£
1.document.write(""); Êä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪ//
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document->html->(head,body)
4.Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄDOM˳ÐòÊÇ:window->(navigator,screen,history,location,document)
5.µÃµ½±íµ¥ÖÐÔªËصÄÃû³ÆºÍ ......
JavascriptÖеij£¼ûÎÊÌâ
1. ¼¯ºÏÀà¶ÔÏóÎÊÌâ
ÏÖÓдúÂëÖÐÐí¶à¼¯ºÏÀà¶ÔÏóÈ¡ÓÃʱʹÓà ()£¬IE ÄܽÓÊÜ£¬Firefox ²»ÄÜ¡£
½â¾ö·½·¨£º¸ÄÓà [] ×÷ΪϱêÔËËã¡£È磺document.forms("formName") ¸ÄΪ
Js´úÂë
document.forms[
"formName"
];
//ÓÖÈ磺
document.getEle ......
µÚ 2 ¼¯
--------------------------------------------------------------------------------
·¶ Àý 5£º
ÔÚ Õâ Ò» ²¿ ·Ö Ê× ÏÈ Òª Ϊ Äã Õ¹ ʾ µÄ JavaScript ÌØ ÐÔ ÊÇ ½« Äã µÄ »¬ Êó ÒÆ µ½ Õâ ¸ö ²» ͬ ÑÕ É«
µÄÁ¬ ½áÉÏ Ã棬 ´Ë ʱ ¿´ ¿´ ä¯ ÀÀ Æ÷ Ï µÄ ×´ ̬ ÁÐ ÓÐ ºÎ ½á ¹û¡£ È» áá Õâ Ñù µÄ ¹¦ ÄÜ ÎÒ ÃÇ ......
Ò»£¬javascriptµÄÄÚ²¿¶ÔÏó£¨Ï൱ÓÚϵͳµ÷Óã¬Æäʵ±¾ÖÊÊÇÒ»¸ö¹¹Ô캯Êý£©
1£¬¶¯Ì¬¶ÔÏó
ʹÓÓ¶ÔÏóʵÀýÃû.³ÉÔ±”µÄ¸ñʽÀ´·ÃÎÊÆäÊôÐԺͷ½·¨¡££¨ÓÃnewÏÈ´´½¨¶ÔÏóʵÀý£©
2£¬¾²Ì¬¶ÔÏó
Ö±½ÓʹÓÓ¶ÔÏóÃû.³ÉÔ±”µÄ¸ñʽÀ´·ÃÎÊÆäÊôÐԺͷ½·¨
¶þ£¬¼¸¸öÄÚÖö ......
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.clientWidth
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.clientHeight
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.offsetWidth(°üÀ¨±ßÏߵĿí)
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetHeight(°üÀ¨±ßÏߵĿí)
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£ºdocument.body.scrollWidth
ÍøÒ³ÕýÎÄÈ«Îĸߣºdocument.body.scrollHeight
ÍøÒ³±»¾íÈ¥µ ......