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
Ïà¹ØÎĵµ£º
×÷ÓÃÓò Scope
Javascript Öеĺ¯ÊýÊôÓÚ´Ê·¨×÷ÓÃÓò£¬Ò²¾ÍÊÇ˵º¯ÊýÔÚËü±»¶¨ÒåʱµÄ×÷ÓÃÓòÖÐÔËÐжø²»ÊÇÔÚ±»Ö´ÐÐʱµÄ×÷ÓÃÓòÄÚÔËÐС£ÕâÊÇϬţÊéÉϵÄ˵·¨¡£µ«“¶¨Òåʱ”ºÍ“Ö´ÐУ¨±»µ÷Óã©Ê±”ÕâÁ½¸ö¶«Î÷ÓÐЩÈ˸㲻Çå³þ¡£¼òµ¥À´Ëµ£¬Ò»¸öº¯ÊýAÔÚ“¶¨Òåʱ”¾ÍÊÇ function A(){} Õâ¸öÓï¾äÖ´ÐеÄʱºò¾Í ......
ÀàÊÇʲô£¿
Ðí¶à¸Õ½Ó´¥±à³ÌµÄÅóÓѶ¼¿ÉÄÜÀí½â²»ÁËÀ࣬ÆäʵÀàÊǶÔÎÒÃÇÕâ¸öÏÖʵÊÀ½çµÄÄ£Ä⣬°ÑËü˵³É“Àà±ð”»òÕß“ÀàÐÍ”¿ÉÄÜ»á¸üÈÝÒ×Àí½âһЩ¡£±ÈÈç“ÈË”ÕâÖÖ¶¯
Îï¾ÍÊÇÒ»¸öÀ࣬¶ø¾ßÌåijһ¸öÈ˾ÍÊÇ“ÈË”Õâ¸öÀàµÄÒ»¸öʵÀý
£¬
“È ......
<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 ......
µÚ¶þÕ Data Access Êý¾Ý·ÃÎÊ
One of the classic computer science problems is determining where data should be stored for optimal reading and writing. Where data is stored is related to how quickly it can be retrieved during code execution. This problem in JavaScri ......