javascript cookies ±£´æ¡¢»ñÈ¡ºÍɾ³ý
CookiesÊÇÒ»ÖÖÄܹ»ÈÃÍøÕ¾·þÎñÆ÷°ÑÉÙÁ¿Êý¾Ý´¢´æµ½¿Í»§¶ËµÄÓ²ÅÌ»òÄڴ棬»òÊÇ´Ó¿Í»§¶ËµÄÓ²Å̶ÁÈ¡Êý¾ÝµÄÒ»ÖÖ¼¼Êõ¡£CookiesÊǵ±Äãä¯ÀÀijÍøվʱ£¬ÓÉWeb·þÎñÆ÷ÖÃÓÚÄãÓ²ÅÌÉϵÄÒ»¸ö·Ç³£Ð¡µÄÎı¾Îļþ£¬Ëü¿ÉÒԼǼÄãµÄÓû§ID¡¢ÃÜÂë¡¢ä¯ÀÀ¹ýµÄÍøÒ³¡¢Í£ÁôµÄʱ¼äµÈÐÅÏ¢¡£µ±ÄãÔÙ´ÎÀ´µ½¸ÃÍøվʱ£¬Íøվͨ¹ý¶ÁÈ¡Cookies£¬µÃÖªÄãµÄÏà¹ØÐÅÏ¢£¬¾Í¿ÉÒÔ×ö³öÏàÓ¦µÄ¶¯×÷£¬ÈçÔÚÒ³ÃæÏÔʾ»¶ÓÄãµÄ±êÓ»òÕßÈÃÄã²»ÓÃÊäÈëID¡¢ÃÜÂë¾ÍÖ±½ÓµÇ¼µÈµÈ¡£
/*
¹¦ÄÜ£º±£´æcookiesº¯Êý
²ÎÊý£ºname£¬cookieÃû×Ö£»value£¬Öµ
*/
function SetCookie(name,value){
var Days = 60; //cookie ½«±»±£´æÁ½¸öÔÂ
var exp = new Date(); //»ñµÃµ±Ç°Ê±¼ä
exp.setTime(exp.getTime() + Days*24*60*60*1000); //»»³ÉºÁÃë
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
/*
¹¦ÄÜ£º»ñÈ¡cookiesº¯Êý
²ÎÊý£ºname£¬cookieÃû×Ö
*/
function getCookie(name){
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr != null)
return unescape(arr[2]);
return null;
}
/*
¹¦ÄÜ£ºÉ¾³ýcookiesº¯Êý
²ÎÊý£ºname£¬cookieÃû×Ö
*/
function delCookie(name){
var exp = new Date(); //µ±Ç°Ê±¼ä
exp.setTime(exp.getTime() - 1);
var cval=getCookie(name);
if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
Ïà¹ØÎĵµ£º
Ëæ×Åä¯ÀÀÆ÷°²È«ÐÔµÄÌá¸ß£¬ÒªÊµÏÖͼƬԤÀÀÒ²Ô½À´Ô½À§ÄÑ¡£
²»¹ýȺÖÚµÄÖÇ»ÛÊÇÎÞÏ޵ģ¬ÍøÉÏÒ²Óкܶà±äͨ»òÏȽøµÄ·½·¨À´ÊµÏÖ¡£
ÔÚÑо¿Á˸÷ÖÖÔ¤ÀÀ·½·¨ºó£¬×÷Ϊ×ܽᣬдÁËÕâ¸ö³ÌÐò£¬¸ú´ó¼ÒÒ»Æð·ÖÏí¡£
ÉÏ´ÎдµÄ¼ò±ãÎÞË¢ÐÂÎļþÉÏ´«ÏµÍ³×î³õµÄÄ¿µÄ¾ÍÊÇÓÃÀ´ÊµÏÖÕâ¸öͼƬԤÀÀЧ¹û¡£
¼æÈÝ£ºie6/7/8, firefox 3.5.5
ºǫ֧́³ÖÏ»¹¼æÈÝ ......
תÔØ:JavaScript»ñÈ¡Ò³Ãæ¿í¶È¸ß¶È´óÈ«
µØÖ·:http://www.cnblogs.com/wcg249165510/archive/2009/02/20/1394749.html
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.clientWidth
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.clientHeight
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.offsetWidth(°üÀ¨±ßÏߵĿí)
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetHeight(° ......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD id="Head1">
<title>JavaScriptµ÷Óñ¾µØÃüÁî</title>
<script type="text/javascript">
function exec (command)
{
window.oldOnError = window.onerror;
window._command = command;
window. ......
function unique(data){debugger;
data = data || [];
var a = {};
for (var i=0; i<data.length; i++) {
var v = data[i];
......
JSON(JavaScript Object Notation) ÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ£¬Ò×ÓÚÔĶÁºÍ±àд£¬Í¬Ê±Ò²Ò×ÓÚ»úÆ÷½âÎöºÍÉú³É¡£Ëü»ùÓÚECMA262ÓïÑԹ淶£¨1999-12µÚÈý°æ£©ÖÐJavaScript±à³ÌÓïÑÔµÄÒ»¸ö×Ó¼¯¡£ JSON²ÉÓÃÓë±à³ÌÓïÑÔÎ޹صÄÎı¾¸ñʽ£¬µ«ÊÇҲʹÓÃÁËÀàCÓïÑÔ£¨°üÀ¨C£¬ C++£¬ C#£¬ Java£¬ JavaScript£¬ Perl£¬ PythonµÈ£©µÄÏ°¹ß£¬ÕâЩÌØÐ ......