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

JavascriptÁ·Ï°ÊµÀý01:³Ë·¨¿Ú¾÷±íÓëɸѡËØÊý

<html>
<body>
<mce:script type="text/javascript"><!--
document.write("<table border=1px>");
for(i=1;i<=9;i++)
{document.write("<tr>");
for (j=1;j<=i;j++)
{document.write("<td class='table1'>"+i+"*"+j+"="+i*j+"&nbsp;&nbsp;</td>");
}
document.write("</tr>");
}
document.write("</table>"); //½áÊø³Ë·¨±í
document.write("<p>"); //»»ÐÐ
//¿ªÊ¼»­10*10·½Õó
document.write("<table border=1px border-color=red>"); //¿ªÊ¼»­±í¸ñ
for(m=1;m<=10;m++){
document.write("<tr>");
for(n=1;n<=10;n++){
document.write("<td class='table2' bgcolor='green'>");
document.write((m-1)*10+n);
document.write("</td>");
}
document.write("</tr>");
}
document.write("</table>");
document.write("<p></p>");
//»­³ö10*10·½Õ󣬲¢É¸Ñ¡³öËØÊý£¬ÓÃÂÌÉ«±ê¼Ç
document.write("<table border=1px border-color=red>"); //¿ªÊ¼»­±í¸ñ
for(m=1;m<=10;m++){
document.write("<tr>"); //¿ªÊ¼Ò»ÐÐ
for(n=1;n<=10;n++){
var r=(m-1)*10+n; //µ±Ç°µ¥Ôª¸ñµÄÊýÖµ
var q=true; //ĬÈÏΪÖÊÊý
if(r>3){for(p=2;p<r/2;p++) //ÅжÏÊÇ·ñΪÖÊÊý
if(r%p==0)q=false;} //Èôµ±Ç°ÊýÖµÄܱ»2——(r-1)Õû³ý£¬Ôò²»ÊÇÖÊÊý¡£
if(q){document.write("<td bgcolor='red' class='table2'>");} //ÈôΪÖÊÊý£¬ÓÃred±³¾°Ìî³ä
else {document.write("<td bgcolor='green' class='table2'>");}//Èô²»ÊÇÖÊÊý£¬ÓÃgreen±³¾°Ìî³ä
document.write(r); //Êä³öµ±Ç°Öµ
document.write("</td>"); //½áÊøµ±Ç°µ¥Ôª¸ñ
}
document.write("</tr>"); //½áÊøµ±Ç°ÐÐ
}
document.write("</table>"); //½áÊø±í¸ñ
// --></mce:script>
</body>
</html> 


Ïà¹ØÎĵµ£º

[·­Òë]High Performance JavaScript(030)

µÚʮՠ Tools  ¹¤¾ß
    Having the right software is essential for identifying bottlenecks in both the loading and running of scripts. A number of browser vendors and large-scale websites have shared techniques and tools to help make the Web faster and more efficient. This ......

JavaScript±à³Ì±Ê¼Ç

ÐÂÖÐ……
1¡¢Êý¾ÝÀàÐÍÑéÖ¤ÎÊÌâ
  Asp.NetËäÈ»ÓÐÑéÖ¤¿Ø¼þ£¬µ«ÊÇÓÐЩ¸´ÔÓµÄÑéÖ¤»¹Êǵô«µ½·þÎñÆ÷ÉϽøÐУ¬ÓÃjsËٶȺÍÐÔÄܶ¼±È½ÏºÃ
<script>
 //¼ì²éÊÇ·ñΪÈÎÒâÊý£¨ÊµÊý£©
function isNumeric(strNumber) {
var newPar=/^(-|\+)?\d+(\.\d+)?$/
alert(newPar.test(strNumber)); }
 //¼ ......

javascript prototype½éÉܵÄÎÄÕÂ

JavaScriptÊÇ»ùÓÚ¶ÔÏóµÄ£¬ÈκÎÔªËض¼¿ÉÒÔ¿´³É¶ÔÏó¡£È»¶ø£¬ÀàÐͺͶÔÏóÊDz»Í¬µÄ¡£±¾ÎÄÖУ¬ÎÒÃdzýÁËÌÖÂÛÀàÐͺͶÔÏóµÄһЩÌصãÖ®Í⣬¸üÖØÒªµÄÊÇÑо¿ÈçºÎд³öºÃµÄ²¢ÇÒÀûÓÚÖØÓõÄÀàÐÍ¡£±Ï¾¹£¬JavaScriptÕâÖÖÁ÷ÐеĽű¾ÓïÑÔÈç¹ûÄܹ»½øÐÐÁ¼ºÃµÄ·â×°£¬²¢ÐγÉÒ»¸öÅÓ´óµÄÀàÐͿ⣬¶ÔÓÚÖØÓÃÊǷdz£ÓÐÒâÒåµÄ¡£
ÍøÉ϶ÔÓÚprototypeµÄÎÄÕ弆 ......

javascript String.replaceº¯Êý

    javascriptµÄStringÀàÄÚÖú¯Êýreplace(regexp, newString)º¯ÊýÌṩÁË×Ö·û´®Ìæ»»¹¦ÄÜ£¬´Óº¯ÊýÔ­ÐÍÉÏ¿ÉÒÔ¿´³öÖ§³Ö Regular Exp¡£´Ëº¯Êý¹¦Äܷdz£ÊµÓ㬵«Ò²Óм¸¸öµØ·½Óеã»ìÏý£¬ÏÂÃæͨ¹ýʵ¼ÊµÄÀý×ÓÀ´ËµÃ÷£º
    ±ÈÈçÎÒÃÇÏÖÔÚÒªÕë¶Ô´®
var src="<a href=&quot;http://xx.com/a/2010 ......

JavaScript¾­µäÓï¾ä¼°Æä»ù±¾Ó¦ÓÃ

¡ö´ò¿ª¡ö
<input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=´ò¿ª>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
¡öÁí´æΪ¡ö
<input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) typ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ