JavaScriptµÄCookiesº¯Êý¿â
// ±£´æCookie
function saveCookie(name, value, expires, path, domain, secure){
var strCookie = name + "=" + value;
if (expires){
// ¼ÆËãCookieµÄÆÚÏÞ, ²ÎÊýΪÌìÊý
var curTime = new Date();
curTime.setTime(curTime.getTime() + expires*24*60*60*1000);
strCookie += "; expires=" + curTime.toGMTString();
}
// CookieµÄ·¾¶
strCookie += (path) ? "; path=" + path : "";
// CookieµÄDomain
strCookie += (domain) ? "; domain=" + domain : "";
// ÊÇ·ñÐèÒª±£ÃÜ´«ËÍ,Ϊһ¸ö²¼¶ûÖµ
strCookie += (secure) ? "; secure" : "";
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
¡¡½éÉÜÔõÑù½â¾öJavaScriptÒ³ÃæË¢ÐÂÓ뵯³ö´°¿ÚµÄÎÊÌâ¡£
¡¡¡¡1.ÎÞÌáʾˢÐÂÍøÒ³
¡¡¡¡´ó¼ÒÓÐûÓз¢ÏÖ£¬ÓÐЩÍøÒ³£¬Ë¢ÐµÄʱºò£¬»áµ¯³öÒ»¸öÌáʾ´°¿Ú£¬µã“È·¶¨”²Å»áˢС£
¡¡¡¡¶øÓеÄÒ³Ãæ²»»áÌáʾ£¬²»µ¯³öÌáʾ´°¿Ú£¬Ö±½Ó¾ÍË¢ÐÂÁË.
¡¡¡¡Èç¹ûÒ³ÃæûÓÐform£¬Ôò²»»áµ¯³öÌáʾ´°¿Ú¡£Èç¹ûÒ³ÃæÓÐform±íµ¥£¬
¡¡¡¡a)< fo ......
ÒªÏëд³ö¿çä¯ÀÀÆ÷µÄjavascript£¬¾Í±ØÐ붮µÃÐá̽¼¼Êõ¡£ÕâÊÇä¯ÀÀÆ÷´óÕ½ÒÅÁôϵĴóµØÀ×£¬ÊÂÒÑÈç´Ë£¬Ö»ºÃÈÏÃü£¬¹Ô¹Ôд·ÖÖ§½á¹¹°É£¬º¯Êý¾ÍÊÇÕâÑù²»Öª²»¾õÖб䳤µÄ¡£
ÏÈ¿´µ¥Ò»ä¯ÀÀÆ÷µÄÅжϣ¬ÎÒÃÇûÓбØÐëÈ¥ÕÒnavigator.userAgentµÄÂé·³£¬ÎÒÔÚ¹úÍâµÄ²©¿ÍÍøÕ¾ÊÕ¼¯ÁËÈçÏÂhack£¬¶ÌС¾«º·£º
ie = !+"\v1" ;
ie ='\v'=='v' ; ......
´úÂëÖ÷ÒªÊDzÙ×÷cookieµÄÁ½¸öº¯Êý£ºÒ»¸öÊÇsetCookieÓÃÓÚÉèÖÃcookieµÄÖµ£¬ÁíÍâÒ»¸öÊÇgetCookie ÓÃÓÚÈ¡cookieµÄÖµ£¬ÊµÏÖÁ˼òµ¥µÄcookie´æÈ¡²Ù×÷£¬ºÜ¼òµ¥£¬´úÂëÈçÏ£º
<mce:script language="JavaScript" type="text/javascript"><!--
function setCookie(name,value)
{
//ÓÃÓÚ´æ´¢¸³Öµ¸ødocument.cookieµÄc ......
ÏÖÔÚÍøÒ³ÉϵÄ×ÖÌåÊÇÔ½À´Ô½Ð¡£¬±ð˵ÊÇÊÓÁ¦Ç·¼ÑÕß¾ÍÊǺÃÑÛ¾¦¿´¾ÃÁËÒ²ÌÛµÄÄÑÊÜ£¬ÓÚÊDZàдÁËÏÂÃæÕâ¶ÎС½Å±¾£¬½¨ÒéÍøÒ³ÖÆ×÷ÈËÄܹ»¼Óµ½ÍøÒ³´úÂëµÄ< head>ÖУ¬ÒÔ·½±ãÈõÊÓÈËȺ·Å´óä¯ÀÀ(½öÊÊÓÃÓÚIEä¯ÀÀÆ÷)£¡
¡¡¡¡´úÂëÈçÏ£º
¡¡¡¡< script language="javascript">
¡¡¡¡var i=0;
¡¡¡¡document.onkeydown = zoom;
¡¡¡¡ ......