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

ͨ¹ýjavascript»ñµÃurl²ÎÊý

Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£ 
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs»ñÈ¡url²ÎÊýÄØ£¿
ÔĶÁ ±à¼­ ÔËÐÐ ¸´ÖÆ  ±£´æ
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript">
function GetUrlParms()
{
var args=new Object();
var query=location.search.substring(1);//»ñÈ¡²éѯ´®
var pairs=query.split("&");//ÔÚ¶ººÅ´¦¶Ï¿ª
for(var i=0;i<pairs.length;i++)
{
var pos=pairs[i].indexOf('=');//²éÕÒname=value
if(pos==-1) continue;//Èç¹ûûÓÐÕÒµ½¾ÍÌø¹ý
var argname=pairs[i].substring(0,pos);//ÌáÈ¡name
var value=pairs[i].substring(pos+1);//ÌáÈ¡value
args[argname]=unescape(value);//´æΪÊôÐÔ
}
return args;
}
//ʹÓ÷½·¨£º
var args = new Object();
args = GetUrlParms();
//Èç¹ûÒª²éÕÒ²ÎÊýArticleID:
var articleID = args["ArticleID"];
alert(articleID);
//Èç¹ûÒª²éÕÒ²ÎÊýTypeID
var typeID = args["TypeID"];
alert(typeID);
</script>
</head>
<body>

</body>
</html>


Ïà¹ØÎĵµ£º

ÓÉdzµ½ÉîÁ˽âJavaScriptÀà

ÀàÊÇʲô£¿
    
   Ðí¶à¸Õ½Ó´¥±à³ÌµÄÅóÓѶ¼¿ÉÄÜÀí½â²»ÁËÀ࣬ÆäʵÀàÊǶÔÎÒÃÇÕâ¸öÏÖʵÊÀ½çµÄÄ£Ä⣬°ÑËü˵³É“Àà±ð”»òÕß“ÀàÐÍ”¿ÉÄÜ»á¸üÈÝÒ×Àí½âһЩ¡£±ÈÈç“ÈË”ÕâÖÖ¶¯
Îï¾ÍÊÇÒ»¸öÀ࣬¶ø¾ßÌåijһ¸öÈ˾ÍÊÇ“ÈË”Õâ¸öÀàµÄÒ»¸öʵÀý
£¬
“È ......

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

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 ......

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

Dynamic Script Elements  ¶¯Ì¬½Å±¾ÔªËØ
    The Document Object Model (DOM) allows you to dynamically create almost any part of an HTML document using JavaScript. At its root, the <script> element isn't any different than any other element on a page: references can be retrie ......

һЩjavascriptÌâÄ¿

ȺÀïÌÖÂÛ¹ýµÄÌâÄ¿£¬·ÖÏíһϡ£
function test(){
var m=n=1;
alert(m);
}
alert(n);
//ÒòΪtestº¯ÊýûÓÐÖ´ÐУ¬³Ì¶È¿ØÖÆÁ÷²»ÄܽøÈë½øÐнâÎö£¬ÀïÃæµÄ¶«Î÷¶ÔÍâÃæ²»¿É¼û£¬Òò´Ë±¨´í
function test(){
var m=n=1;
alert(m);
}
test();
alert(n);
//µ±testÖ´Ðкó£¬Í ......

javascriptдÀ෽ʽ֮Èý

È¡Ç°ÃæÁ½ÖÖµÄÓŵ㣺
a¡¢Óù¹Ô캯ÊýÀ´¶¨ÒåÀàÊôÐÔ£¨×ֶΣ©
b¡¢ÓÃÔ­ÐÍ·½Ê½À´¶¨ÒåÀàµÄ·½·¨¡£
¾ÍÓÐÁ˵ÚÈýÖÖ·½Ê½¡£ÕâÖÖ·½Ê½Ã²ËƲÉÓõÄÈ˽϶ࡣ
3¡¢×ۺϹ¹Ô캯Êý/Ô­ÐÍ
/**
* PersonÀࣺ¶¨ÒåÒ»¸öÈË£¬ÓиöÊôÐÔname£¬ºÍÒ»¸ögetName·½·¨
* @param {String} name
*/
function Person(name) {
this.name = name;
}
Pers ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ