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

JavaScript¾²Ì¬Ò³ÃæÖµ´«µÝÖ®Cookie

¡¡¡¡ÀûÓÃCookie£ºCookieÊÇä¯ÀÀÆ÷´æ´¢ÉÙÁ¿ÃüÃûÊý¾Ý.ËüÓëij¸öÌض¨µÄÍøÒ³»òÍøÕ¾¹ØÁªÔÚÒ»Æð¡£
¡¡¡¡CookieÓÃÀ´¸øä¯ÀÀÆ÷ÌṩÄÚ´æ,ÒÔ±ã½Å±¾ºÍ·þÎñÆ÷³ÌÐò¿ÉÒÔÔÚÒ»¸öÒ³ÃæÖÐʹÓÃÁíÒ»¸öÒ³ÃæµÄÊäÈëÊý¾Ý¡£
¡¡¡¡Post.htm
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
<input type="text" name="txt1">
<input type="button" value="Post">
<script language="javascript" >
function setCookie(name,value)
{
/*
*--------------- setCookie(name,value) -----------------
* setCookie(name,value)
* ¹¦ÄÜ:ÉèÖõñäÁ¿nameµÄÖµ
* ²ÎÊý:name,×Ö·û´®;value,×Ö·û´®.
* ʵÀý:setCookie('username','baobao')
*--------------- setCookie(name,value) -----------------
*/
¡¡¡¡var Days = 30; //´Ë cookie ½«±»±£´æ 30 Ìì
¡¡¡¡var exp¡¡= new Date();
¡¡¡¡exp.setTime(exp.getTime() + Days*24*60*60*1000);
¡¡¡¡document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
¡¡¡¡location.href = "Read.htm"; //½ÓÊÕÒ³Ãæ.
}
</script>
¡¡¡¡Read.htm
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
<script language="javascript" >
function getCookie(name)
{
/*
*--------------- getCookie(name) -----------------
* getCookie(name)
* ¹¦ÄÜ:È¡µÃ±äÁ¿nameµÄÖµ
* ²ÎÊý:name,×Ö·û´®.
* ʵÀý:alert(getCookie("baobao"));
*--------------- getCookie(name) -----------------
*/
¡¡¡¡var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
¡¡¡¡if(arr !=null) return unescape(arr[2]); return null;
}
alert(getCookie("baobao"));
</script>
¡¡¡¡Óŵã:¿ÉÒÔÔÚͬԴÄÚµÄÈÎÒâÍøÒ³ÄÚ·ÃÎÊ.ÉúÃüÆÚ¿ÉÒÔÉèÖÃ.
¡¡¡¡È±µã:Öµ³¤¶ÈÓÐÏÞÖÆ.


Ïà¹ØÎĵµ£º

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

Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£ 
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......

¡¾×ª¡¿FirefoxºÍIEÖ®¼ä7¸öJavaScriptµÄ²îÒì


¾¡¹Ü JavaScript ÀúÊ·ÉÏʹÓÃÈß³¤¶øÁîÈËÉúÑáµÄ´úÂë¿éÀ´±êµÄÌض¨ä¯ÀÀÆ÷µÄʱÆÚÒѾ­½áÊøÁË£¬µ«ÊÇż¶ûʹÓÃһЩ¼òµ¥µÄ´úÂë¿éºÍ¶ÔÏó¼ì²âÀ´È·±£Ò»Ð©´úÂëÔÚÓû§»úÆ÷ÉÏÕý³£¹¤×÷ÒÀÈ»ÊDZØÒªµÄ¡£
ÕâƪÎÄÕÂÖУ¬ÎÒ»áÂÔÊöһϠInternet Explorer ºÍ Firefox ÔÚ JavaScript Óï·¨Éϲ»Í¬µÄ 7 ¸ö·½Ãæ¡£
1. CSS “float” ÊôÐÔ
Ȗ ......

javascript CDATAµÄÒâÒå

CDATA ÄÚ²¿µÄËùÓж«Î÷¶¼»á±»½âÎöÆ÷ºöÂÔ¡£
¼ÙÈçÎı¾Öаüº¬ÁË´óÁ¿µÄ "<" ºÍ "&" ×Ö·û - ¾ÍÏñ±à³Ì´úÂëÖо­³£³öÏÖµÄÇé¿öÒ»Ñù - ÄÇôÕâ¸ö XML ÔªËؾͿÉÒÔ±»¶¨ÒåΪһ¸ö CDATA ²¿·Ö¡£
CDATA Çø¶Î¿ªÊ¼ÓÚ "<![CDATA["£¬½áÊøÓÚ "]]>"£º
<script type="text/javascript">
<![CDATA[
function compare(a,b) ......

15 ¸ö JavaScript Web UI ¿â

¼¸ºõËùÓеĸ» Web Ó¦Óö¼»ùÓÚÒ»¸ö»ò¶à¸ö Web UI ¿â»ò¿ò¼Ü£¬ÕâЩ UI
¿âÓë¿ò¼Ü¼«´óµØ¼ò»¯ÁË¿ª·¢½ø³Ì£¬²¢´øÀ´Ò»Ö£¬¿É¿¿£¬ÒÔ¼°¸ß¶È½»»¥ÐÔµÄÓû§½çÃæ¡£±¾ÎĽéÉÜÁË 15 ¸ö·Ç³£Ç¿´óµÄ JavaScript Web UI
¿â£¬·Ç³£Êʺϸ÷ÖÖ¸÷ÖÖ¹æÄ£µÄ¸» Web Ó¦ÓõĿª·¢¡£
LivePipe
LivePipe
UI
»ùÓÚ Prototype Javascript ¿ò¼Ü
£¬°üº ......

javascriptµÄһЩ¹¤¾ß

JS Check£º
javascriptlint http://www.javascriptlint.com/index.htm
jslint http://www.jslint.com/
JS UT£º
http://www.jsunit.net/
JS ST£º
http://www.outofhanwell.com/ieleak/index.php?title=Main_Page Drip
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
http://blogs.msdn. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ