javascriptÖÐsetTimeout()º¯Êý
javascriptÖÐsetTimeout()º¯Êý
´ó¼Ò¶¼ÖªµÀjavascriptÖеÄsetTimeput()º¯ÊýµÄ×÷Óã¬Ò»°ã»áÓÃËûÀ´´¦ÀíһЩÁ¬ÐøµÄÊÂÇ飬ÃÇÏÈ¿´Ò»¸öÀý×Ó£º
<head>
<script>
function init()
{
setTimeout("init2()",0);
alert("1");
}
function init2()
{
alert("2");
}
</script>
</head>
<body onload="init()">
</body>
Ò²ÐíºÜ¶àÈËÈÏΪ½á¹ûÊÇ£º2 1£¬ ¶øÇ¡Ç¡½á¹ûÊÇ£º1 2 ¡£ÕâÊÇΪʲôÄØ£¿Ã÷Ã÷ÑÓ³Ùʱ¼äÉèÖõÄÊÇ0£¬Ó¦¸ÃÊÇÁ¢¿ÌÏÈÖ´ÐÐinit2()°¡£¿ÎÒÃÇ¿ÉÒÔÕâÑùÈÏΪ£¬setTimeout()º¯Êý»á×Ô¼ºÖØÐÂÉêÇëÒ»¸ö¶ÑÕ»¿Õ¼ä£¬¶ø²»ÊôÓÚµ±Ç°º¯Êýinit()µÄ¶ÑÕ»¿Õ¼ä£¬ËùÒÔinit()ÏÈÈëÕ»£¬alert("1")µÚ2¸öÈëÕ»£¬µ±init()º¯ÊýÖ´ÐÐÍêºó£¬setTimeout()²ÅÖ´ÐС£
µ±È»ÕâÀïûÓÐÉæ¼°µ½²ÎÊý´«µÝ,ÔÙ¿´Õâ¸öÀý×Ó£º
<head>
<script>
var rgbcolor=new Array(3);
var whichtr=0;
function changeColor(wh)
{
whichtr=wh;
for(var i=0;i<3;i++)
{rgbcolor[i]=Math.ceil(Math.random()*255);}
trID[whichtr].style.backgroundColor="rgb("+rgbcolor[0]+","+rgbcolor[1]+","+rgbcolor[2]+")";
setTimeout("changeColor("+whichtr+")",1000);
}
</script>
</head> <body>
<table border="1" height="400" width="500" align="center" cellspacing="0">
<tr onmousedown="changeColor(0)" id="trID"><td>0</td></tr
Ïà¹ØÎĵµ£º
³ö´¦£ºhttp://www.jcwcn.com/article/2005/1210/javascript_17476.html
<HTML>
<HEAD>
<title>WEBÒ³Ãæµ¼³öΪEXCELÎĵµµÄ·½·¨
</title>
</HEAD>
<body>
<BR>
<table id = "PrintA" width="100%" border="1" cell ......
ÕâÁ½Ì쿪ʼд¹Å´úµØͼµÄGISÍøÕ¾£¬Ëµ°×Á˾ÍÊÇÓùŴúµØͼµÄÄÚÈÝЧ·ÂɽկһϹȸèµØͼ¡£
JSÕⶫÎ÷ºÜ¾ÃûдÁË£¬ÓÐЩ¸ÅÄîÒ²ºÜÄ£ºý£¬µ¼ÖÂÍê³É·Ö¿éÍ϶¯¼ÓÔصŦÄܾͻ¨Á˺öàʱ¼ä¡£
Ö÷ÒªÎÊÌâÊdzöÔÚÍ϶¯Ê±¶ÔÔªËØÄÚÈݵĶ¯Ì¬ÐÞ¸ÄÉÏ£¬×ܽáÏ¡£
ͨ¹ýJS½Å±¾¶¯Ì¬ÐÞ¸ÄDOMÔªËØÄÚÈÝͨ³£ÓÐÁ½ÖÖ·½·¨£º
1. ͨ¹ýDOM±ê×¼½Ó¿Ú´´½¨ÔªËØ
var new ......
//¸÷Öֳߴç
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.offs ......
O3D ÊÇÒ»¸ö¿ªÔ´µÄWeb API£¬Æä¿ÉÒÔ´´½¨Ï൱ţXµÄ»ùÓÚä¯ÀÀÆ÷µÄ¿É½»»¥Ê½µÄ3DÓ¦Óá£Õâ¸öAPIÔÚºÜÓпÉÄÜ»áÐγÉÒÔºóµÄWebÉϵÄ3DͼÐεıê×¼¡£ÏÂÃæÊÇÕâ¸öAPIµÄÖ÷Õ¾µã£º http://code.google.com/apis/o3d/ ¡£O3DÄ¿Ç°Ö§³ÖWindows, MacºÍLinuxÈýÖÖƽ̨¡£
ÏÂÃæÊÇһЩ¼òµ¥µØʹÓÃO3DµÄAPIµÄÈçºÎ´´½¨Ò»¸öÁ¢·½Ì壬¸üÏêϸµÄÄÚÈÝÇ ......
1.HTMLÎĵµÊ÷Ðαíʾ
2.Node[] Node.childNodes
//·µ»ØNode¶ÔÏóµÄËùÓÐ×Ö½Úµã
3.Node.firstChild / lastChild /nextSibling(ÏÂÒ»¸öÐֵܽڵã) / previousSibling (ÉÏÒ»¸öÐֵܽڵã) / parentNode
ÊôÐÔ
4.Node.appendChild() / removeChild() / replaceChil ......