posts - 495,comments - 227,trackbacks - 0
          讀取cookie: ?
          function ?readCookie(name) ?
          { ?
          ? ?var ?cookieValue ?= ?""; ?
          ? ?var ?search ?= ?name ?+ ?"="; ?
          ? ?if(document.cookie.length ?> ?0) ?
          ? ?{ ? ?
          ? ? ? ?offset ?= ?document.cookie.indexOf(search); ?
          ? ? ? ?if ?(offset ?!= ?-1) ?
          ? ? ? ?{ ? ?
          ? ? ? ? ? ?offset ?+= ?search.length; ?
          ? ? ? ? ? ?end ?= ?document.cookie.indexOf(";", ?offset); ?
          ? ? ? ? ? ?if ?(end ?== ?-1) ?end ?= ?document.cookie.length; ?
          ? ? ? ? ? ?cookieValue ?= ?unescape(document.cookie.substring(offset, ?end)) ?
          ? ? ? ?} ?
          ? ?} ?
          ? ?return ?cookieValue; ?
          } ?
          alert( ?readCookie("myCookie") ?); ?
          ?
          寫入cookie: ?
          function ?writeCookie(name, ?value, ?hours) ?
          { ?
          ? ?var ?expire ?= ?""; ?
          ? ?if(hours ?!= ?null) ?
          ? ?{ ?
          ? ? ? ?expire ?= ?new ?Date((new ?Date()).getTime() ?+ ?hours ?* ?3600000); ?
          ? ? ? ?expire ?= ?"; ?expires=" ?+ ?expire.toGMTString(); ?
          ? ?} ?
          ? ?document.cookie ?= ?name ?+ ?"=" ?+ ?escape(value) ?+ ?expire; ?
          } ?
          writeCookie("myCookie", ?"my ?name", ?24); ?
          ?
          --------------------------------------------------------------- ?
          ?
          + ?號字符串連接符號 ?
          ?
          至于cookies,請看: ?
          ?
          用 ?COOKIES ?記錄一個人訪問次數的小程序。 ?
          ?
          <script ?language="JavaScript"> ?
          <!-- ?
          var ?caution ?= ?false ?
          function ?setCookie(name, ?value, ?expires, ?path, ?domain, ?secure) ?{ ?
          ? ? ? ? ? ? ? ?var ?curCookie ?= ?name ?+ ?"=" ?+ ?escape(value) ?+ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((expires) ?? ?"; ?expires=" ?+ ?expires.toGMTString() ?: ?"") ?+ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((path) ?? ?"; ?path=" ?+ ?path ?: ?"") ?+ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((domain) ?? ?"; ?domain=" ?+ ?domain ?: ?"") ?+ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((secure) ?? ?"; ?secure" ?: ?"") ?
          ? ? ? ? ? ? ? ?if ?(!caution ? ?| ?| ?(name ?+ ?"=" ?+ ?escape(value)).length ?<= ?4000) ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?document.cookie ?= ?curCookie ?
          ? ? ? ? ? ? ? ?else ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if ?(confirm("Cookie ?exceeds ?4KB ?and ?will ?be ?cut!")) ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?document.cookie ?= ?curCookie ?
          } ?
          function ?getCookie(name) ?{ ?
          ? ? ? ? ? ? ? ?var ?prefix ?= ?name ?+ ?"=" ?
          ? ? ? ? ? ? ? ?var ?cookieStartIndex ?= ?document.cookie.indexOf(prefix) ?
          ? ? ? ? ? ? ? ?if ?(cookieStartIndex ?== ?-1) ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?return ?null ?
          ? ? ? ? ? ? ? ?var ?cookieEndIndex ?= ?document.cookie.indexOf(";", ?cookieStartIndex ?+ ?
          prefix.length) ?
          ? ? ? ? ? ? ? ?if ?(cookieEndIndex ?== ?-1) ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?cookieEndIndex ?= ?document.cookie.length ?
          ? ? ? ? ? ? ? ?return ?unescape(document.cookie.substring(cookieStartIndex ?+ ?
          prefix.length, ?cookieEndIndex)) ?
          } ?
          function ?deleteCookie(name, ?path, ?domain) ?{ ?
          ? ? ? ? ? ? ? ?if ?(getCookie(name)) ?{ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?document.cookie ?= ?name ?+ ?"=" ?+ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((path) ?? ?"; ?path=" ?+ ?path ?: ?"") ?+ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((domain) ?? ?"; ?domain=" ?+ ?domain ?: ?"") ?+ ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"; ?expires=Thu, ?01-Jan-70 ?00:00:01 ?GMT" ?
          ? ? ? ? ? ? ? ?} ?
          } ?
          function ?fixDate(date) ?{ ?
          ? ? ? ? ? ? ? ?var ?base ?= ?new ?Date(0) ?
          ? ? ? ? ? ? ? ?var ?skew ?= ?base.getTime() ?
          ? ? ? ? ? ? ? ?if ?(skew ?> ?0) ?
          ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?date.setTime(date.getTime() ?- ?skew) ?
          } ?
          var ?now ?= ?new ?Date() ?
          fixDate(now) ?
          now.setTime(now.getTime() ?+ ?365 ?* ?24 ?* ?60 ?* ?60 ?* ?1000) ?
          var ?visits ?= ?getCookie("counter") ?
          if ?(!visits) ?
          ? ? ? ? ? ? ? ?visits ?= ?1 ?
          else ?
          ? ? ? ? ? ? ? ?visits ?= ?parseInt(visits) ?+ ?1 ?
          setCookie("counter", ?visits, ?now) ?
          document.write("歡迎您第 ?" ?+ ?visits ?+ ?" ?次來到本站點") ?
          // ?--> ?
          </script> ?
          ?
          --------------------------------------------------------------- ?
          ?
          function ?setCookie(name,value) ?
          { ?
          ? ? ?var ?Days ?= ?30; ?
          ? ? ?var ?exp ? ?= ?new ?Date(); ? ? ? ?//new ?Date("December ?31, ?9998"); ?
          ? ? ? ? ? ? ?exp.setTime(exp.getTime() ?+ ?Days*24*60*60*1000); ?
          ? ? ? ? ? ? ?document.cookie ?= ?name ?+ ?"="+ ?escape ?(value) ?+ ?";expires=" ?+ ?exp.toGMTString(); ?
          } ?
          function ?getCookie(name) ?
          { ?
          ? ? ?var ?arr,reg=new ?RegExp("(^ ?| ?)"+name+"=([^;]*)(; ?|$)"); ?
          ? ? ? ? ? ? ?if(arr=document.cookie.match(reg)) ?return ?unescape(arr[2]); ?
          ? ? ? ? ? ? ?else ?return ?null; ?
          } ?
          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(); ?
          }??
          posted on 2006-07-31 13:21 SIMONE 閱讀(209) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 佛学| 宁化县| 灵石县| 包头市| 崇左市| 西乌珠穆沁旗| 达州市| 巩留县| 香河县| 大港区| 太原市| 长海县| 玉龙| 邛崃市| 米易县| 三明市| 汤原县| 巴林左旗| 蕲春县| 孙吴县| 古浪县| 息烽县| 泉州市| 庆阳市| 郑州市| 临沧市| 颍上县| 丽江市| 巴林右旗| 延川县| 桦川县| 上高县| 沙坪坝区| 香河县| 靖江市| 潢川县| 南部县| 扶风县| 噶尔县| 大荔县| 苍溪县|