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

Javascript²Ù×÷Cookie

<script>
function getCookieVal(offset) {
  var endstr = document.cookie.indexOf(";",offset);
  if(endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset,endstr));
}
function FixCookieDate(data) {
  var base = new Date(0);
  var skew = base.getTime();
  if(skew > 0)
    date.setTime(date.getTime() - skew);
}
function GetCookie(name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while(i < clen) {
    var j = i + alen;
    if(document.cookie.substring(i,j) == arg)
      return getCookieVal(j);
    i = document.cookie.indexOf(" ",i) + 1;
    if(i == 0) break;
  }
  return null;
}
function SetCookie(name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
function DeleteCookie(name,path,domain) {
  if(GetCookie(name)) {
    document.cookie = name + "==" +
      ((path) ? "; path=" + path : "") +
      "; expires=The,01-Jan-70 00:00:01 GMT";
  }
}
var expdate = new Date();
FixCookieDate(expdate);
expdate.setTime(expdate.getTime() + (365*24*60*60*1000));
</script>
<script>
//¶ÁÈ¡COOKIE
// alert( readCookie("myCookie") );
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  {
    offset = document.cookie.indexOf(search);
    if (offset != -1)
  &


Ïà¹ØÎĵµ£º

¡¶Îò͸javascript¡·Ñ§Ï°±Ê¼Ç£ºÒ»¡¢Ç°ÑÔ

¡¶Îò͸JavaScript¡·Ñ§Ï°±Ê¼Ç
 
Ô­ÎĵØÖ·£ºhttp://www.cnblogs.com/leadzen/archive/2008/02/25/1073404.html
 
ÕâÊÇÒ»±¾ºÜÐÎÏóÉú¶¯µÄÊ飬ʹÎÒÃÇ¿ÉÒÔ¸üÉîµØÁ˽âÁËJavaScript¡£
 
ÒýÑÔ
 
   ±à³ÌÊÀ½çÀïÖ»´æÔÚÁ½ÖÖ»ù±¾ÔªËØ£¬Ò»¸öÊÇÊý¾Ý£¬Ò»¸öÊÇ´úÂë¡£±à³ÌÊÀ½ç¾ÍÊÇÔÚÊý¾ÝºÍ´úÂëǧ˿ÍòÂƵ ......

JavaScriptº¯Êý±Õ°ü(closure) µÄÀí½â

×Ô´ÓѧϰJavaScriptÒÔÀ´£¬Ò»Ö±¶Ôº¯Êý±Õ°ü²»ÊÇÌ«Àí½â¡£ÖªµÀ´ó¸ÅÊÇʲô¸öÒâ˼£¬µ«ÊÇÒª½«Ò»¸ö²»»áµÄÈ˽̻ỹÕæ²»ÐС£×ÜÖ®¾ÍÊDz»Äܳ¹µ×µÄÀí½â¡£
½ñÌì¿´µ½µÄÕâƪÎÄÕ¸оõ²»´í£¬ºÍ´ó¼Ò·ÖÏíһϡ£
http://www.felixwoo.com/archives/247 ......

JavaScript³£Ó÷½·¨×ܽᗗһЩº¯Êý

¸ù¾ÝÉí·ÝÖ¤ºÅÂëÈ¡µÃÉúÈÕÓëÐԱ𣬲¢ÅжÏ18λÉí·ÝÖ¤µÄÕýÈ·Óë´íÎó:
function showBirthday(val){
var birthdayValue;
if(15==val.length){//15λÉí·ÝÖ¤ºÅÂë
birthdayValue = val.charAt(6)+val.charAt(7);
if(parseInt(birthdayValue)<10){
birthdayValue = '20'+birthdayValue;
}else{
birthdayValue = '1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ