Javascriptµ¯³ö¶Ô»°¿ò3ÖÖ·½Ê½
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ÈýÖÖµ¯³ö¶Ô»°¿òµÄÓ÷¨ÊµÀý</title>
<script language=javascript >
function ale()
{
//Õâ¸ö»ù±¾Ã»ÓÐʲô˵µÄ£¬¾ÍÊǵ¯³öÒ»¸öÌáÐѵĶԻ°¿ò
alert("ÎÒ¸Ò±£Ö¤£¬¼ÖÅôÄãÏÖÔÚÓõÄÊÇÑÝʾһ£ºÌáÐѶԻ°¿ò");
}
function firm()
{
//ÀûÓöԻ°¿ò·µ»ØµÄÖµ£¨true »òÕß false£©
if(confirm("ÄãÈ·ÐÅҪתȥ¼ÖÅôµÄ²©¿Í£¿"))
{//Èç¹ûÊÇtrue £¬ÄÇô¾Í°ÑÒ³ÃæתÏòttp://hi.baidu.com/jiapeng8624237
location.href="http://hi.baidu.com/jiapeng8624237";
}
else
{
//·ñÔò˵Ã÷ÏÂÁË£¬ºðºð……
alert("Äã°´ÁËÈ¡Ïû£¬ÄǾÍÊÇ·µ»Øfalse");
}
}
function prom()
{
var name=prompt("ÇëÊäÈëÄúµÄÃû×Ö","YoungBabyÌáÐÑÄúÔÚÕâÀïÊäÈëÄúµÄÃû×Ö");//½«ÊäÈëµÄÄÚÈݸ³¸ø±äÁ¿ name £¬
//ÕâÀïÐèҪעÒâµÄÊÇ£¬promptÓÐÁ½¸ö²ÎÊý£¬Ç°ÃæÊÇÌáʾµÄ»°£¬ºóÃæÊǵ±¶Ô»°¿ò³öÀ´ºó£¬ÔÚ¶Ô»°¿òÀïµÄĬÈÏÖµ
if(name)//Èç¹û·µ»ØµÄÓÐÄÚÈÝ
{
&nb
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
/**
* JavaScript ÊÇÃæÏò¶ÔÏóµÄÓïÑÔ£¬µ«ÊÇËûµÄÃæÏò¶ÔÏó²»ÊÇ»ùÓÚÀàµÄ£¬ÊÇ»ùÓÚÔÐ͵Ä;
* µ«ÊÇËûµÄһЩÌØÐÔ(º¯ÊýÊÇÊý¾Ý)£¬Ê¹µÃËü¿ÉÒÔÄ£Äâ»ùÓÚÀàµÄÃæÏò¶ÔÏ󣬵«ÊÇ JavaScript ²¢²»Ö§³ÖºÍ Java Ò»ÑùµÄÀ࣬
* Òò´Ë JavaScript ÖеÄ"Àà"¿ÉÒÔ³Æ×÷"αÀà"
*/
//
/**
* ¹¹Ô캯Êý: js ÖÐÓÃÀ´ºÍ new ÔËËã·ûÒ»ÆðʹÓõĺ¯Êý³Æ× ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; ......
<html>
<body>
<script type="text/javascript">
//·½·¨Ò»
var num_arr= [];
for (var i = 0 ; i < 10 ; i ++)
{
num_arr[i] = i;
}
document.write(num_arr+'</br>');
//·½·¨¶þ
var obj_arr=new Array();
obj_arr[6]='ss';
document.write(obj_arr.len ......
Grouping Scripts ³É×é½Å±¾
Since each <script> tag blocks the page from rendering during initial download, it's helpful to limit the total number of <script> tags contained in the page. This applies to both inline scripts as well as those in external files. Every time ......