<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[javascript读写cookie的方法代码]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 22 Apr 2008 01:28:26 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	IE浏览器里输入：javascript.document.cookie=&quot;name=xiangdong&quot;<br/>chrome里读取：<br/>console.log(document.cookie)<br/>language1=zh; uin=7srsOd27A3NlR3MU5LVzWg%3D%3D<br/>chrome里设置：<br/>document.cookie=&quot;name=xiangdong&quot;<br/>&quot;name=xiangdong&quot;<br/>console.log(document.cookie)<br/>name=xiangdong; language1=zh; uin=7srsOd27A3NlR3MU5LVzWg%3D%3D<br/>===============================================<br/>&lt;script langrage=javascript&gt;<br/>// writeCookie(&quot;myCookie&quot;, &quot;my name&quot;, 24);<br/>// Stores the string &quot;my name&quot; in the cookie &quot;myCookie&quot; which expires after 24 hours.<br/>// The hours parameter is optional; if hours is left out, the cookie value expires at the end of the visitor&#039;s browser session.<br/>function writeCookie(name, value, hours)<br/>{<br/>&nbsp;&nbsp;var expire = &quot;&quot;;<br/>&nbsp;&nbsp;if(hours != null)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;expire = new Date((new Date()).getTime() + hours * 3600000);<br/>&nbsp;&nbsp;&nbsp;&nbsp;expire = &quot;; expires=&quot; + expire.toGMTString();<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;document.cookie = name + &quot;=&quot; + escape(value) + expire;<br/>}<br/><br/>// Example:<br/>// alert( readCookie(&quot;myCookie&quot;) );<br/><br/>function readCookie(name)<br/>{<br/>&nbsp;&nbsp;var cookieValue = &quot;&quot;;<br/>&nbsp;&nbsp;var search = name + &quot;=&quot;;<br/>&nbsp;&nbsp;if(document.cookie.length &gt; 0)<br/>&nbsp;&nbsp;{ <br/>&nbsp;&nbsp;&nbsp;&nbsp;offset = document.cookie.indexOf(search);<br/>&nbsp;&nbsp;&nbsp;&nbsp;if (offset != -1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;{ <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offset += search.length;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end = document.cookie.indexOf(&quot;;&quot;, offset);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (end == -1) end = document.cookie.length;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookieValue = unescape(document.cookie.substring(offset, end))<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;return cookieValue;<br/>}<br/>&lt;/script&gt;<br/>&lt;body&gt;<br/>&lt;script&gt;<br/>writeCookie(&quot;name&quot;,&quot;xiangdong2&quot;,24);<br/>alert( readCookie(&quot;name&quot;) );<br/>&lt;/script&gt;<br/>&lt;/body&gt;
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] javascript读写cookie的方法代码]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>