ÖÊÊý Javascript ֮ǰµÄÄǸöÓеãС벡
<mce:script type="text/javascript"><!--
document.write("<table border=1px border-color=red>"); //±í¸ñ¿ªÊ¼
for (h = 1; h <= 10; h++) {
document.write("<tr>"); //¿ªÊ¼µÚÒ»ÐÐ
for (s = 1; s <= 10; s++) {
var num = (h-1)*10+s; //µ±Ç°¸ñÖеÄÊýÖµ
var zs = true; //ĬÈÏZSΪÖÊÊý
if (num > 0) {
for (z = 2; z <= num/2; z++) //ÅжÏÊÇ·ñÖÊÊý
if (num%z == 0) {
zs = false;
}
if (num == 1) {
zs = false;
}
} //È統ǰֵÄܱ»2Õû³ý»òֵΪ1£¬Ôò²»ÊÇÖÊÊý
if (zs) {
document.write("<td bgcolor='red' class='table2'>"); //Èç¹ûÊÇÖÊÊý£¬µ±Ç°±í¸ñΪºìÉ«
}
else {
document.write("<td bgcolor='green' class='table2'>"); //Èç¹û²»ÊÇÖÊÊý£¬µ±Ç°¸ñΪÂÌÉ«
}
document.write(num); //Êä³öµ±Ç°Öµ
document.write("</td>"); //µ±Ç°ÁнáÊø
}
document.write("</tr>"); //µ±Ç°ÐнáÊø
}
document.write("</table>"); //±í¸ñ½áÊø
// --></mce:script>
Ïà¹ØÎĵµ£º
Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......
ÐÂÖÐ……
1¡¢Êý¾ÝÀàÐÍÑéÖ¤ÎÊÌâ
Asp.NetËäÈ»ÓÐÑéÖ¤¿Ø¼þ£¬µ«ÊÇÓÐЩ¸´ÔÓµÄÑéÖ¤»¹Êǵô«µ½·þÎñÆ÷ÉϽøÐУ¬ÓÃjsËٶȺÍÐÔÄܶ¼±È½ÏºÃ
<script>
//¼ì²éÊÇ·ñΪÈÎÒâÊý£¨ÊµÊý£©
function isNumeric(strNumber) {
var newPar=/^(-|\+)?\d+(\.\d+)?$/
alert(newPar.test(strNumber)); }
//¼ ......
JavaScriptÊÇ»ùÓÚ¶ÔÏóµÄ£¬ÈκÎÔªËض¼¿ÉÒÔ¿´³É¶ÔÏó¡£È»¶ø£¬ÀàÐͺͶÔÏóÊDz»Í¬µÄ¡£±¾ÎÄÖУ¬ÎÒÃdzýÁËÌÖÂÛÀàÐͺͶÔÏóµÄһЩÌصãÖ®Í⣬¸üÖØÒªµÄÊÇÑо¿ÈçºÎд³öºÃµÄ²¢ÇÒÀûÓÚÖØÓõÄÀàÐÍ¡£±Ï¾¹£¬JavaScriptÕâÖÖÁ÷ÐеĽű¾ÓïÑÔÈç¹ûÄܹ»½øÐÐÁ¼ºÃµÄ·â×°£¬²¢ÐγÉÒ»¸öÅÓ´óµÄÀàÐͿ⣬¶ÔÓÚÖØÓÃÊǷdz£ÓÐÒâÒåµÄ¡£
ÍøÉ϶ÔÓÚprototypeµÄÎÄÕ弆 ......
ʹÓùýajaxµÄ¶¼³£¼ûÕâÑùµÄ´úÂ룺
<a href="javascript:doTest2();void(0);" mce_href="javascript:doTest2();void(0);">here</a>
µ«Õâ¶ùµÄvoid(0)¾¿¾¹ÊǺκ¬ÒåÄØ£¿
JavascriptÖÐvoidÊÇÒ»¸ö²Ù×÷·û£¬¸Ã²Ù×÷·ûÖ¸¶¨Òª¼ÆËãÒ»¸ö±í´ïʽµ«ÊDz»·µ»ØÖµ¡£
void ²Ù×÷·ûÓ÷¨¸ñʽÈçÏ£º
1. jav ......
JavaScriptµÄä¯ÀÀÆ÷¶ÔÏóÏê½â
Ò»¡¢ä¯ÀÀÆ÷¶ÔÏó²ã´Î¼°ÆäÖ÷Òª×÷ÓÃ
¶þ¡¢Îĵµ¶ÔÏó¹¦Äܼ°Æä×÷ÓÃ
Èý¡¢·¶Àý
ʹÓÃä¯ÀÀÆ÷µÄÄÚ²¿¶ÔÏóϵͳ, ¿ÉʵÏÖÓëHTMLÎĵµ½øÐн»»¥¡£ËüµÄ×÷ÓÃÊǽ«Ïà¹ØÔªËØ×éÖ¯°ü×°ÆðÀ´£¬Ìṩ¸ø³ÌÐòÉè¼ÆÈËԱʹÓ㬴Ӷø¼õÇá±à³ÌÈ˵ÄÀͶ¯£¬Ìá¸ßÉè¼ÆWebÒ³ÃæµÄÄÜÁ¦¡£
Ò»¡¢ä¯ÀÀÆ÷¶ÔÏó²ã´Î¼°ÆäÖ ......