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

Javascript »ñÈ¡Á´½Ó(url)²ÎÊýµÄ·½·¨

 ×÷Õß:
YITU.org    
À´Ô´:
YITU.org    

ʱ¼ä:
2007-02-26 10:34:58

ÓÐʱÎÒÃÇÐèÒªÔÚ¿Í»§¶Ë»ñÈ¡Á´½Ó²ÎÊý£¬Ò»¸ö³£¼ûµÄ·½·¨Êǽ«Á´½Óµ±×ö×Ö·û´®£¬°´ÕÕÁ´½ÓµÄ¸ñʽ·Ö½â£¬È»ºó»ñÈ¡¶ÔÓ¦µÄ²ÎÊýÖµ¡£±¾Îĸø³öµÄ¾ÍÊÇÕâ¸öÁ÷³ÌµÄ¾ßÌåʵÏÖ·½·¨¡£
µ±È»£¬ÎÒÃÇÒ²¿ÉÒÔÓÃÕýÔòÖ±½ÓÆ¥Å䣬ÎÄÕÂÖÐÒ²¸ø³öÁËÒ»¸öÕýÔòµÄÀý×Ó¡£

--------------------------------------------------------------

µã´Ëä¯ÀÀʾÀýÎļþ

--------------------------------------------------------------
·Ö½âÁ´½ÓµÄ·½Ê½£º
Javascript
:
 
<script type="text/javascript
"
>
<!--
// ˵Ã÷£ºJavascript
»ñÈ¡Á´½Ó(url)²ÎÊýµÄ·½·¨
// ÕûÀí£ºhttp://www.CodeBit.cn
 
function
getQueryString(
name
)

{

// Èç¹ûÁ´½ÓûÓвÎÊý£¬»òÕßÁ´½ÓÖв»´æÔÚÎÒÃÇÒª»ñÈ¡µÄ²ÎÊý£¬Ö±½Ó·µ»Ø¿Õ
if
(
location.href
.indexOf
(
"?"
)
==-1
|| location.href
.indexOf
(
name
+'='
)
==-1
)

{

return
''
;
}

 
// »ñÈ¡Á´½ÓÖвÎÊý²¿·Ö
var
queryString = location.href
.substring
(
location.href
.indexOf
(
"?"
)
+1
)
;
 
// ·ÖÀë²ÎÊý¶Ô ?key=value&key2=value2
var
parameter
s = queryString.split
(
"&"
)
;
 
var
pos, paraName, paraValue;
for
(
var
i=0
; i<parameter
s.length
; i++)

{

// »ñÈ¡µÈºÅλÖÃ
pos = parameter
s[
i]
.indexOf
(
'='
)
;
if
(
pos == -1
)
{
continue
; }

 
// »ñÈ¡name ºÍ value
paraName = parameter
s[
i]
.substring
(
0
, pos)
;
paraValue = parameter
s[
i]
.substring
(
pos + 1
)
;
 
// Èç¹û²éѯµÄnameµÈÓÚµ±Ç°name£¬¾Í·µ»Øµ±Ç°Öµ£¬Í¬Ê±£¬½«Á´½ÓÖеÄ+ºÅ»¹Ô­³É¿Õ¸ñ
if
(
paraName == name
)

{

return
unescape(
paraValue.replace
(
/\+/g
, " "
)
)
;
}

}

return
''
;
}
;
 
//http:


Ïà¹ØÎĵµ£º

javascript String2

javascriptÖÐÓÐÒ»ÖÖ·½·¨½Ð×ö·º»¯·½·¨£¬Ö¸ÄÇÖÖÔ­Éú¶ÔÏ󲻿ɱéÀúµÄÔ­ÐÍ·½·¨¡£ÈçArrayµÄpop£¬sliceµÈ¡£ÎÒÃDZØÐëÖªµÀËüÃǵÄÃû×Ö²ÅÄܵ÷ÓÃËü»òÕß°ÑËüÍÚ³öÀ´¡£¼ÙÈçÎÒÃÇÏëÉè¼ÆÒ»¸öÀ࣬ӵÓÐÓëStringͬÑùµÄ¹¦ÄÜ£¬ÎÒÃǾÍÓÐÕâÐèÒª¡£²»Èç·Å¿ªµã˵£¬ÎªÊ²Ã´ÒªÉè¼ÆÕâ¸öÀà°É£¬ÏÔÈ»String2µÄЧÂʲ»ÈçÔ­ÉúµÄ£¬µ«ÊÂÇé×ÜÒªÍùÁ½Ãæ¿´¡£ÕýÈçC#²»Èç¶þ ......

firefoxÓëIE¼æÈÝjavascriptºÍCSS


css:
1.   
ul±êÇ©ÖÐFFÖÐÓиöpaddingÖµ£¬È´Ã»ÓÐmarginÖµ£¬¶øÔÚIEÖÐÕýºÃÏà·´   
½â¾ö°ì·¨:½«ulµÄpaddingºÍmargin¶¼ÉèΪ0(Ò²¿ÉÒÔ²»ÊÇ0)È磺padding:0;margin:0;list-style:none;   
ÁíÍâformĬÈÏÔÚIEÖÐÒ²»áÓÐmarginÖµ£¬ËùÒÔ×îºÃÒ²½«ÆämarginºÍpaddingÉèΪ0   
2.    ......

JavaScriptÀàÐÍת»»

 ·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ»ØµÄ¶¼ÊÇNaN(Not a Number)¡£
ÔÚÅжÏ×Ö·û´®ÊÇ·ñÊÇÊý×Öֵǰ£¬parseI ......

JavaScript toFixed() ·½·¨

 Ô­ÎĵØÖ·£º http://www.w3school.com.cn/js/jsref_tofixed.asp
¶¨ÒåºÍÓ÷¨
toFixed() ·½·¨¿É°Ñ Number ËÄÉáÎåÈëΪָ¶¨Ð¡ÊýλÊýµÄÊý×Ö¡£
Óï·¨
NumberObject.toFixed(num)
²ÎÊýÃèÊö
num
±ØÐè¡£¹æ¶¨Ð¡ÊýµÄλÊý£¬ÊÇ 0 ~ 20 Ö®¼äµÄÖµ£¬°üÀ¨ 0 ºÍ 20£¬ÓÐЩʵÏÖ¿ÉÒÔÖ§³Ö¸ü´óµÄÊýÖµ·¶Î§¡£Èç¹ûÊ¡ÂÔÁ˸òÎÊý£¬½«Óà 0 ´úÌ ......

javascriptµÄparseIntº¯Êý(ת)

 javascriptµÄparseIntº¯Êý
javascriptµÄparseIntº¯Êý£¬´ó¼Ò¶¼ÖªµÀÊǸÉɶµÄ
µ«ÄãÖªµÀ
parseInt("07") ·µ»Ø¶àÉÙ ?
parseInt("08") ÓÖ·µ»Ø¶àÉÙ ?
ÕýÈ·´ð°¸ÊÇ
parseInt("07") ·µ»Ø8
parseInt("08") ·µ»Ø0
ÄãÖªµÀÎÊÌâÔÚÄÄ£¿
Æäʵ£¬Õâ¸öÎÊÌâ¿ÉÄÜ´ó¼Ò¶¼Ã»Ïë¹ý°É¡£
ÓÃjavascriptµÄparseIntº¯Êýʱ£¬
parseInt("08") ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ