<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/feedsky2.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/liuyixi" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/liuyixi" type="application/rss+xml"></fs:self_link><lastBuildDate>Wed, 11 Apr 2012 06:23:50 GMT</lastBuildDate><title>一兮-生活，工作，点点滴滴</title><description>09全新记录方式，琐事，Hack，ASP，PHP，c++，vbs，网络技术，网站SEO，经验共分享，在摸索中前进</description><link>http://blog.liuyixi.com</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Wed, 11 Apr 2012 06:23:50 GMT</pubDate><item><title>Javascript复制JSON数据</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355348/5368011/1/item.html</link><content:encoded>&lt;p&gt;复制数据很简单。&lt;/p&gt;
&lt;p&gt;var a = jsonobj;&lt;/p&gt;
&lt;p&gt;简单的就将jsonobj的值复制到了变量a中，但如果jsonobj是个json数据的话，你会发现修改a的值时，jsonobj也会跟着改变。&lt;/p&gt;
&lt;p&gt;如果你对javascript中的prototype那套机制比较了解的话可能就会大概明白是怎么回事，是的，因为json其实也是个object，所以var a = jsonobj 赋值时，中间有个原型链会将两个关联起来。&lt;/p&gt;
&lt;p&gt;要达到想要的复制数据也很简单：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;var a = JSON.parse(JSON.stringify(jsonobj));&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;将json序列化为string再还原成json，因为中间产生了新的对象，所以两者不再关联。&lt;/p&gt;
&lt;p&gt;这种写法看起来很不科学，但应该是比较好的办法了。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355348/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355348/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2012/04/11/javascriptfuzhijsonshuju/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>复制数据很简单。 var a = jsonobj; 简单的就将jsonobj的值复制到了变量a中，但如果jsonobj是个json数据的话，你会发现修改a的值时，jsonobj也会跟着改变。 如果你对javascript中的prototype那套机制比较了解的话可能就会大概明白是怎么回事，是的，因为json其实也是个object，所以var a = jsonobj 赋值时，中间有个原型链会将两个关联起来。 要达到想要的复制数据也很简单： var a = JSON.parse(JSON.stringify(jsonobj)); 将json序列化为string再还原成json，因为中间产生了新的对象，所以两者不再关联。 这种写法看起来很不科学，但应该是比较好的办法了。&lt;img src=&quot;http://www1.feedsky.com/t1/626355348/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355348/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>JSON</category><category>javascript</category><pubDate>Wed, 11 Apr 2012 14:23:50 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2012/04/11/javascriptfuzhijsonshuju/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=1048</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2012/04/11/javascriptfuzhijsonshuju/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355348/5368011</fs:itemid></item><item><title>新Indexed Database(indexdb)标准</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355349/5368011/1/item.html</link><content:encoded>&lt;p&gt;W3c在去年12月6日时对indexdb的草案做了一些修改，虽然变动不是很大，但是却直接使得以前的代码不能正常work，主要在数据库创建的部分。&lt;/p&gt;
&lt;p&gt;目前firefox10以后以及ie10(windows8 Consumer Preview)支持此标准，chrome未测，未知，但未来应该都会遵循这个标准。&lt;/p&gt;
&lt;p&gt;具体的可以参考w3c的官方文档，地址在这里 ：&lt;a href=&quot;http://www.w3.org/TR/IndexedDB/&quot; target=&quot;_blank&quot;&gt;http://www.w3.org/TR/IndexedDB/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;在网上查找关于indexdb的教程的也需注意查看时间，如果是针对firefox10之前的代码或者12月6日前的代码在最新的浏览器上是不能正常work的。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;写这篇文章本来是要填之前在那边win8的文章里说IE10里面indexdb bug那个坑的。后来重构的时候，发现这并不是BUG，是遵循的标准程度不一样的原因。而伴随着前几天windows8 consumer preview新出来的IE10已经遵循最新的indexdb标准，所以代码已经和firefox一样，所以这里不再理会那个所谓的bug.这里重点讲下新的数据库声明方式（这是变动部分），而是用indexdb的方法并没有变动。&lt;/p&gt;
&lt;p&gt;比较大的一个变动部分是废弃了以前的 setVersion()方法，所以导致我们在创建数据库和createObjectStore的流程有一些变动，而且多了一些新的回调方法。&lt;/p&gt;
&lt;p&gt;首先是创建数据库&lt;/p&gt;

&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p10422&quot;&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot; id=&quot;p1042code2&quot;&gt;&lt;pre class=&quot;javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; DB&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
window.&lt;span style=&quot;color: #660066;&quot;&gt;indexedDB&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; window.&lt;span style=&quot;color: #660066;&quot;&gt;indexedDB&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;||&lt;/span&gt; window.&lt;span style=&quot;color: #660066;&quot;&gt;webkitIndexedDB&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;||&lt;/span&gt; window.&lt;span style=&quot;color: #660066;&quot;&gt;mozIndexedDB&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//各浏览器的各自的私有方法，这个不多说了；&lt;/span&gt;
DB.&lt;span style=&quot;color: #660066;&quot;&gt;openDatabase&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
   console.&lt;span style=&quot;color: #660066;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'Database open'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;   &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//数据库初始化完成后我们回到这里。&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
DB.&lt;span style=&quot;color: #660066;&quot;&gt;openDatabase&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;callback&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; request &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; indexedDB.&lt;span style=&quot;color: #000066;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'quicknote'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;   &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//注意区别以前的方法，这里第二个参数不再是description，而是数据库版本号&lt;/span&gt;
   request.&lt;span style=&quot;color: #660066;&quot;&gt;onsuccess&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;     &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//数据库打开成功回调&lt;/span&gt;
       DB.&lt;span style=&quot;color: #660066;&quot;&gt;db&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; e.&lt;span style=&quot;color: #660066;&quot;&gt;target&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;    &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//我们用DB.db来存放indexdb&lt;/span&gt;
       callback&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   request.&lt;span style=&quot;color: #660066;&quot;&gt;onupgradeneeded&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;    &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//第一次打开数据库或数据库升级时会触发，完成后根据情况触发success或者error&lt;/span&gt;
       DB.&lt;span style=&quot;color: #660066;&quot;&gt;db&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; e.&lt;span style=&quot;color: #660066;&quot;&gt;target&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
       &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; db &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; DB.&lt;span style=&quot;color: #660066;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
       &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;DB.&lt;span style=&quot;color: #660066;&quot;&gt;db&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;objectStoreNames&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;contains&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'notes'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;    &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//createObjectStore,以前需要在setVersion时才能执行。&lt;/span&gt;
	&lt;span style=&quot;color: #009966; font-style: italic;&quot;&gt;/* create object store*/&lt;/span&gt;
	  db.&lt;span style=&quot;color: #660066;&quot;&gt;createObjectStore&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'notes'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;keyPath&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'id'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; autoIncrement&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;
	      .&lt;span style=&quot;color: #660066;&quot;&gt;createIndex&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'updated'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #3366CC;&quot;&gt;'updated'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt; unique&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
       &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   request.&lt;span style=&quot;color: #000066;&quot;&gt;onerror&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;   &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//数据库打开错误回调&lt;/span&gt;
       console.&lt;span style=&quot;color: #660066;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;上面就是新的indexdb的数据库初始化方式，相对以前的来说，代码简化了不少，也不用人为的判断数据库版本号了。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355349/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355349/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2012/03/08/xinindexeddatabaseindexdbbiaozhun/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>W3c在去年12月6日时对indexdb的草案做了一些修改，虽然变动不是很大，但是却直接使得以前的代码不能正常work，主要在数据库创建的部分。 目前firefox10以后以及ie10(windows8 Consumer Preview)支持此标准，chrome未测，未知，但未来应该都会遵循这个标准。 具体的可以参考w3c的官方文档，地址在这里 ：http://www.w3.org/TR/IndexedDB/ 在网上查找关于indexdb的教程的也需注意查看时间，如果是针对firefox10之前的代码或者12月6日前的代码在最新的浏览器上是不能正常work的。 写这篇文章本来是要填之前在那边win8的文章里说IE10里面indexdb bug那个坑的。后来重构的时候，发现这并不是BUG，是遵循的标准程度不一样的原因。而伴随着前几天windows8 consumer preview新出来的IE10已经遵循最新的indexdb标准，所以代码已经和firefox一样，所以这里不再理会那个所谓的bug.这里重点讲下新的数据库声明方式（这是变动部分），而是用indexdb的方法并没有变动。 比较大的一个变动部分是废弃了以前的 setVersion()方法，所以导致我们在创建数据库和createObjectStore的流程有一些变动，而且多了一些新的回调方法。 首先是创建数据库 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 var DB=&amp;#123;&amp;#125;; window.indexedDB = window.indexedDB &amp;#124;&amp;#124; window.webkitIndexedDB &amp;#124;&amp;#124; window.mozIndexedDB; //各浏览器的各自的私有方法，这个不多说了； DB.openDatabase&amp;#40;function&amp;#40;&amp;#41;&amp;#123; console.log&amp;#40;'Database open'&amp;#41;; //数据库初始化完成后我们回到这里。 &amp;#125;&amp;#41;; [...]&lt;img src=&quot;http://www1.feedsky.com/t1/626355349/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355349/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>indexdb</category><category>HTML5</category><pubDate>Thu, 08 Mar 2012 10:59:46 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2012/03/08/xinindexeddatabaseindexdbbiaozhun/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=1042</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2012/03/08/xinindexeddatabaseindexdbbiaozhun/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355349/5368011</fs:itemid></item><item><title>烦心事真多，很无助。</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355350/5368011/1/item.html</link><content:encoded>&lt;p&gt;家里遇到一些事，很是烦恼。&lt;br /&gt;
却又无能为力。&lt;br /&gt;
感觉自己帮不上什么忙又是很无助。&lt;br /&gt;
我需要一些法律援助，有谁能推荐吗？&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355350/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355350/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2012/02/28/fanxinshizhenduohenwuzhu/feed/</wfw:commentRss><slash:comments>3</slash:comments><description>家里遇到一些事，很是烦恼。 却又无能为力。 感觉自己帮不上什么忙又是很无助。 我需要一些法律援助，有谁能推荐吗？&lt;img src=&quot;http://www1.feedsky.com/t1/626355350/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355350/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>工作记录</category><pubDate>Tue, 28 Feb 2012 21:47:57 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2012/02/28/fanxinshizhenduohenwuzhu/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=1039</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2012/02/28/fanxinshizhenduohenwuzhu/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355350/5368011</fs:itemid></item><item><title>关于win8 metro版的Quick Note</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355351/5368011/1/item.html</link><content:encoded>&lt;p&gt;随着US时间1月8号M$第一波参赛程序的提交截止，Quick Note for Win8的开发也算是告一段落，中间因为一些各种准备不充分问题，虽然这次提交的版本还没达到最完美的我想要的最完美的状态，但总算顺利的完成任务。&lt;/p&gt;
&lt;p&gt;这之间有很多波折，从最早的win8 developer preview发布时，我曾第一时间在我的笔记本上直接硬盘安装win8，大概的了解了metro界面和以前传统desktop的区别，并简单的从visual studio 11 preview中创建了一个split的javascript metro项目，build，整个过程很顺利，简单的浏览了项目文件的组成，当时评估是基于web的APP很好移植，甚至你可以简单的理解成使用javascript build的metro程序其实就是封装了一个全屏的IE10而已（现在开来，这句话理解也确实没有错）。&lt;/p&gt;
&lt;p&gt;凭着这个了解，粗略的评估了quick note应该是比较容易移植到win8 metro下，而因为preview中的win8 app store并没有开放，当时得到的消息是今年的2月份开放，所以这事情搁置了一旁，然后投入到另一个项目的开发中。&lt;/p&gt;
&lt;p&gt;然后上个月下旬的时候得到一个消息说，M$在5个国家地区（不包括CN）有个第一波提交metro app的评选，将会出现在win8 beta版本的store中预置，这是个绝好的先机，所以迅速将重心转移到这边。&lt;/p&gt;
&lt;p&gt;首先要思考的第一个问题是quick note数据的存放问题，因为考虑之前偶尔会有用户抱quick note chrome版本数据丢失的问题，所以这次想找个比较稳妥的数据储存模式，在了解懂啊winRT并没有提供SQL的数据库支持，并在一些第三方的选择比如winrtsql等，最后还是选择了使用html5中的indexdb，第一，这是metro中唯一有文档的数据库级别的储存，第二，之前在firefox中的quick note也是使用indexdb储存，移植应该会很顺利。&lt;/p&gt;
&lt;p&gt;然后是文件的迁移，并解决一些列bug，以及一些IE10的兼容问题，以及一些metro app的一些特殊兼容问题，比如不允许直接使用innerHTML之类的方法（当然也包括jquery的.html()方法），debug，竟然出奇的顺利，两天时间就能把chrome的quick note移植到win8中，并还有和diigo的云同步功能。&lt;/p&gt;
&lt;p&gt;事情转变在某天晚上看了win8 build大会的视频后，重新认识了metro UI的设计。&lt;/p&gt;
&lt;p&gt;因比赛的评分使用metro UI的分值比重是50%，看了视频后，直接推翻直接准备在基于split view的模板上重新设计quick note。&lt;/p&gt;
&lt;p&gt;和UI nancy简单的讨论后，然后开始迅速的搭建HTML结构原型。&lt;/p&gt;
&lt;p&gt;并尽量的去使用metro winJS中提供的UI，比如app bar ,setting ,listview之类的东西。&lt;/p&gt;
&lt;p&gt;后来又添加上了系统层的share，search之类的东西。&lt;/p&gt;
&lt;p&gt;因为时间问题，中间取舍了很多，最后提交的版本中，里面有个indexdb的小bug也未来得及解决，只是用了一些hack的办法去处理（关于什么bug，和firefox中indexdb的区别，我后面会专门开文章介绍）。&lt;/p&gt;
&lt;p&gt;虽然赶在了截止之前提交了程序，但是是否能入围，只能祈祷。我自己做出来的东西，我只能打70分，如果给我更充裕的时间，我能研究透win8的API，应该能把quick note做的更完善。&lt;/p&gt;
&lt;p&gt;祈祷能入围吧。&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;size-full wp-image-1037 aligncenter&quot; title=&quot;win8&quot; src=&quot;http://blog.liuyixi.com/wp-content/uploads/2012/01/win8.png&quot; alt=&quot;&quot; width=&quot;703&quot; height=&quot;496&quot; /&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355351/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355351/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2012/01/10/guanyuwin8metrobandequicknote/feed/</wfw:commentRss><slash:comments>4</slash:comments><description>随着US时间1月8号M$第一波参赛程序的提交截止，Quick Note for Win8的开发也算是告一段落，中间因为一些各种准备不充分问题，虽然这次提交的版本还没达到最完美的我想要的最完美的状态，但总算顺利的完成任务。 这之间有很多波折，从最早的win8 developer preview发布时，我曾第一时间在我的笔记本上直接硬盘安装win8，大概的了解了metro界面和以前传统desktop的区别，并简单的从visual studio 11 preview中创建了一个split的javascript metro项目，build，整个过程很顺利，简单的浏览了项目文件的组成，当时评估是基于web的APP很好移植，甚至你可以简单的理解成使用javascript build的metro程序其实就是封装了一个全屏的IE10而已（现在开来，这句话理解也确实没有错）。 凭着这个了解，粗略的评估了quick note应该是比较容易移植到win8 metro下，而因为preview中的win8 app store并没有开放，当时得到的消息是今年的2月份开放，所以这事情搁置了一旁，然后投入到另一个项目的开发中。 然后上个月下旬的时候得到一个消息说，M$在5个国家地区（不包括CN）有个第一波提交metro app的评选，将会出现在win8 beta版本的store中预置，这是个绝好的先机，所以迅速将重心转移到这边。 首先要思考的第一个问题是quick note数据的存放问题，因为考虑之前偶尔会有用户抱quick note chrome版本数据丢失的问题，所以这次想找个比较稳妥的数据储存模式，在了解懂啊winRT并没有提供SQL的数据库支持，并在一些第三方的选择比如winrtsql等，最后还是选择了使用html5中的indexdb，第一，这是metro中唯一有文档的数据库级别的储存，第二，之前在firefox中的quick note也是使用indexdb储存，移植应该会很顺利。 然后是文件的迁移，并解决一些列bug，以及一些IE10的兼容问题，以及一些metro app的一些特殊兼容问题，比如不允许直接使用innerHTML之类的方法（当然也包括jquery的.html()方法），debug，竟然出奇的顺利，两天时间就能把chrome的quick note移植到win8中，并还有和diigo的云同步功能。 事情转变在某天晚上看了win8 build大会的视频后，重新认识了metro UI的设计。 因比赛的评分使用metro UI的分值比重是50%，看了视频后，直接推翻直接准备在基于split view的模板上重新设计quick note。 和UI nancy简单的讨论后，然后开始迅速的搭建HTML结构原型。 并尽量的去使用metro winJS中提供的UI，比如app bar ,setting ,listview之类的东西。 后来又添加上了系统层的share，search之类的东西。 因为时间问题，中间取舍了很多，最后提交的版本中，里面有个indexdb的小bug也未来得及解决，只是用了一些hack的办法去处理（关于什么bug，和firefox中indexdb的区别，我后面会专门开文章介绍）。 虽然赶在了截止之前提交了程序，但是是否能入围，只能祈祷。我自己做出来的东西，我只能打70分，如果给我更充裕的时间，我能研究透win8的API，应该能把quick note做的更完善。 祈祷能入围吧。&lt;img src=&quot;http://www1.feedsky.com/t1/626355351/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355351/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>metro</category><category>CSS</category><category>win8</category><category>javascript</category><category>工作记录</category><pubDate>Tue, 10 Jan 2012 00:16:24 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2012/01/10/guanyuwin8metrobandequicknote/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=1033</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2012/01/10/guanyuwin8metrobandequicknote/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355351/5368011</fs:itemid></item><item><title>javascript 处理二进制流</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355352/5368011/1/item.html</link><content:encoded>&lt;p&gt;在javascript中，二进制流一般是一个[object ArrayBuffer]的对象，一般的javascript方法是没法处理这个object的。&lt;/p&gt;
&lt;p&gt;要处理它，我们需要用Uint8Array将它转换成一个8位的整形数组。&lt;/p&gt;
&lt;p&gt;当然，如果你需要，你还能将它还原成string&lt;/p&gt;

&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p10054&quot;&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot; id=&quot;p1005code4&quot;&gt;&lt;pre class=&quot;javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;// t is a arraybuffer&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; uInt8Array &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;new&lt;/span&gt; Uint8Array&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;t&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//转换为二进制数组 例如 var byte3 = uInt8Array[4]&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;i&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;uInt8Array.&lt;span style=&quot;color: #660066;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;i&lt;span style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
  d&lt;span style=&quot;color: #339933;&quot;&gt;+=&lt;/span&gt;String.&lt;span style=&quot;color: #660066;&quot;&gt;fromCharCode&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;uInt8Array&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355352/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355352/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2011/10/27/javascriptchulierjinzhiliu/feed/</wfw:commentRss><slash:comments>2</slash:comments><description>在javascript中，二进制流一般是一个[object ArrayBuffer]的对象，一般的javascript方法是没法处理这个object的。 要处理它，我们需要用Uint8Array将它转换成一个8位的整形数组。 当然，如果你需要，你还能将它还原成string 1 2 3 4 5 6 7 8 // t is a arraybuffer &amp;#160; var uInt8Array = new Uint8Array&amp;#40;t&amp;#41;; //转换为二进制数组 例如 var byte3 = uInt8Array[4] &amp;#160; for&amp;#40;i=0;i&amp;#60;uInt8Array.length;i++&amp;#41;&amp;#123; d+=String.fromCharCode&amp;#40;uInt8Array&amp;#91;i&amp;#93;&amp;#41; &amp;#125;&lt;img src=&quot;http://www1.feedsky.com/t1/626355352/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355352/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>HTML5</category><category>二进制</category><category>javascript</category><pubDate>Thu, 27 Oct 2011 17:19:02 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2011/10/27/javascriptchulierjinzhiliu/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=1005</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2011/10/27/javascriptchulierjinzhiliu/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355352/5368011</fs:itemid></item><item><title>CSS3最新中文手册</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355353/5368011/1/item.html</link><content:encoded>&lt;p&gt;来自其他网站的，这个比较全：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://css.doyoe.com/&quot;&gt;http://css.doyoe.com/&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355353/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355353/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2011/10/14/css3zuixinzhongwenshouce/feed/</wfw:commentRss><slash:comments>2</slash:comments><description>来自其他网站的，这个比较全： http://css.doyoe.com/&lt;img src=&quot;http://www1.feedsky.com/t1/626355353/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355353/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>DIV+CSS Design</category><category>css3</category><pubDate>Fri, 14 Oct 2011 09:04:14 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2011/10/14/css3zuixinzhongwenshouce/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=995</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2011/10/14/css3zuixinzhongwenshouce/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355353/5368011</fs:itemid></item><item><title>JS 获取浏览器版本</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355354/5368011/1/item.html</link><content:encoded>&lt;p&gt;在写JS时，很多情况我们需要知道浏览器的版本来做一些工作。&lt;/p&gt;
&lt;p&gt;javascript获取浏览器版本方法：&lt;/p&gt;

&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p9896&quot;&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot; id=&quot;p989code6&quot;&gt;&lt;pre class=&quot;javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//获取浏览器名&lt;/span&gt;
navigator.&lt;span style=&quot;color: #660066;&quot;&gt;appName&lt;/span&gt;    &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;// Microsoft Internet Explorer / Netscape 等等&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//针对IE 获取详细浏览器版本&lt;/span&gt;
navigator.&lt;span style=&quot;color: #660066;&quot;&gt;appVersion&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;   &lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;// MSIE 8.0 / 7.0 /6.0&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//其他获得浏览器详细版本&lt;/span&gt;
navigator.&lt;span style=&quot;color: #660066;&quot;&gt;appVersion&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;在chrome/firefox中，navigator 这个全局对象还提供了更多的关于客户端的信息，有兴趣可以console一下或者each一下。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355354/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355354/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2011/10/11/jshuoqulanqibanben/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>在写JS时，很多情况我们需要知道浏览器的版本来做一些工作。 javascript获取浏览器版本方法： 1 2 3 4 5 6 7 8 //获取浏览器名 navigator.appName // Microsoft Internet Explorer / Netscape 等等 &amp;#160; //针对IE 获取详细浏览器版本 navigator.appVersion.split&amp;#40;&amp;#34;;&amp;#34;&amp;#41;&amp;#91;1&amp;#93; // MSIE 8.0 / 7.0 /6.0 &amp;#160; //其他获得浏览器详细版本 navigator.appVersion 在chrome/firefox中，navigator 这个全局对象还提供了更多的关于客户端的信息，有兴趣可以console一下或者each一下。&lt;img src=&quot;http://www1.feedsky.com/t1/626355354/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355354/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>firefox</category><category>chrome</category><category>IE</category><category>javascript</category><pubDate>Tue, 11 Oct 2011 17:06:54 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2011/10/11/jshuoqulanqibanben/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=989</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2011/10/11/jshuoqulanqibanben/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355354/5368011</fs:itemid></item><item><title>Android调试，还是得原生ROM好</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355355/5368011/1/item.html</link><content:encoded>&lt;p&gt;之前在把diigo的power note的界面做了一些调整，在我的milestone上调试的时候，发现设置的titlebar的高度在一些activity生效，一些activity不生效，而且变的很窄。&lt;/p&gt;
&lt;p&gt;当时手机的ROM是最新的MIUI，程序在android虚拟机上一切正常。后来猜测是可能是因为MIUI的深度定制UI导致这个BUG的发生。&lt;/p&gt;
&lt;p&gt;下载了CM7重刷后，果然如此，问题解决。&lt;/p&gt;
&lt;p&gt;如此，只能抛弃持续使用一年的MIUI了。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355355/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355355/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2011/10/10/androiddiaoshihuanshideyuanshengromhao/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>之前在把diigo的power note的界面做了一些调整，在我的milestone上调试的时候，发现设置的titlebar的高度在一些activity生效，一些activity不生效，而且变的很窄。 当时手机的ROM是最新的MIUI，程序在android虚拟机上一切正常。后来猜测是可能是因为MIUI的深度定制UI导致这个BUG的发生。 下载了CM7重刷后，果然如此，问题解决。 如此，只能抛弃持续使用一年的MIUI了。&lt;img src=&quot;http://www1.feedsky.com/t1/626355355/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355355/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>android</category><category>MIUI</category><category>CM7</category><category>Android</category><pubDate>Mon, 10 Oct 2011 11:11:27 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2011/10/10/androiddiaoshihuanshideyuanshengromhao/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=986</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2011/10/10/androiddiaoshihuanshideyuanshengromhao/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355355/5368011</fs:itemid></item><item><title>git查看远程仓库地址</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355356/5368011/1/item.html</link><content:encoded>&lt;p&gt;或许一些人使用git很少在命令行下，一般都会使用类似smartgit之类的可视化工具。如何查看当前项目的远程地址呢：&lt;/p&gt;
&lt;p&gt;$ git remote -v&lt;/p&gt;
&lt;p&gt;这个命令可以显示对应项目的远程克隆地址。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355356/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355356/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2011/09/29/gitchakanyuanchengcangkudizhi/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>或许一些人使用git很少在命令行下，一般都会使用类似smartgit之类的可视化工具。如何查看当前项目的远程地址呢： $ git remote -v 这个命令可以显示对应项目的远程克隆地址。&lt;img src=&quot;http://www1.feedsky.com/t1/626355356/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355356/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>项目</category><category>git</category><category>工作记录</category><pubDate>Thu, 29 Sep 2011 11:32:41 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2011/09/29/gitchakanyuanchengcangkudizhi/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=974</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2011/09/29/gitchakanyuanchengcangkudizhi/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355356/5368011</fs:itemid></item><item><title>Add-on SDK 关于content scirpt的一些</title><link>http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355357/5368011/1/item.html</link><content:encoded>&lt;p&gt;Firefox 的Add-on SDK (jetpack)从1.0rc2版本开始后，对content script的机制有个重要的改动，现在不能在content script中直接来操作页面的dom 和监听DOM事件&lt;/p&gt;
&lt;p&gt;但诡异的是，这个改动它并没有写到它的开发文档里面。虽然可能的原因是使用到这个用处的人并不多或者jetpack本就不提倡这样使用。&lt;/p&gt;
&lt;p&gt;因为在Read Later Fast / Quick Note / Awesome Screenshot  for firefox 都使用到了这些东西，从而导致使用新的SDK build后的一些功能失效。&lt;/p&gt;
&lt;p&gt;最初以为是BUG，去mozilla的bug系统搜时发现果然有这么一个说法：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=660780&quot; target=&quot;_blank&quot;&gt;https://bugzilla.mozilla.org/show_bug.cgi?id=660780&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;后来看到release note中确实提到了关于content script的改动：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;We&amp;#8217;ve changed the way content scripts interact with web pages, in order to improve security.&lt;/p&gt;
&lt;p&gt;Previously, content scripts that accessed DOM objects in the page would frequently access the same objects as those being accessed by the page. This gives rise to two problems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;many changes to the page would be visible to the page, making it obvious to the page that an add-on was modifying it.&lt;/li&gt;
&lt;li&gt;a malicious page might redefine functions and properties of them so they don&amp;#8217;t do what the add-on expects. For example, if a content script calls&lt;code&gt;document.getElementById()&lt;/code&gt; to retrieve a DOM element, then a malicious page could redefine its behavior to return something unexpected.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To deal with these problems, DOM objects like the global window object are now implemented in a way that ensures that content scripts that access those objects will get the native implementations of their properties and methods.&lt;/p&gt;
&lt;p&gt;Content scripts that modify those DOM objects will modify a proxy object instead of the real object.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;大致是说，为了安全性考虑云云，在content script与DOM交互的时候用到一个中间的代理。&lt;/p&gt;
&lt;p&gt;但这个代理是什么却没有明确的说道，你需要去参考那个bug页面阅读后才明白是怎么回事。&lt;/p&gt;
&lt;p&gt;简单点说，就是content script使用的页面的window对象不再是当前的window对象，而使用了一个代理的的 unsafeWindow 对象&lt;/p&gt;
&lt;p&gt;如果这个变动导致你在content script中使用的document 或者jquery函数失效的话，你可以在content script中加上这么一句：&lt;/p&gt;

&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p9628&quot;&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot; id=&quot;p962code8&quot;&gt;&lt;pre class=&quot;javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; document&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;unsafeWindow.&lt;span style=&quot;color: #660066;&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;$&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;unsafeWindow.$&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/626355357/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355357/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.liuyixi.com/2011/09/09/add-onsdkguanyucontentscirptdeyixie/feed/</wfw:commentRss><slash:comments>2</slash:comments><description>Firefox 的Add-on SDK (jetpack)从1.0rc2版本开始后，对content script的机制有个重要的改动，现在不能在content script中直接来操作页面的dom 和监听DOM事件 但诡异的是，这个改动它并没有写到它的开发文档里面。虽然可能的原因是使用到这个用处的人并不多或者jetpack本就不提倡这样使用。 因为在Read Later Fast / Quick Note / Awesome Screenshot  for firefox 都使用到了这些东西，从而导致使用新的SDK build后的一些功能失效。 最初以为是BUG，去mozilla的bug系统搜时发现果然有这么一个说法： https://bugzilla.mozilla.org/show_bug.cgi?id=660780 后来看到release note中确实提到了关于content script的改动： We&amp;#8217;ve changed the way content scripts interact with web pages, in order to improve security. Previously, content scripts that accessed DOM objects in the page would frequently access the [...]&lt;img src=&quot;http://www1.feedsky.com/t1/626355357/liuyixi/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/liuyixi/~8046913/626355357/5368011/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>firefox</category><category>插件开发</category><category>插件</category><category>add-on sdk</category><category>jetpack</category><category>Firefox</category><pubDate>Fri, 09 Sep 2011 11:27:34 +0800</pubDate><author>一兮</author><comments>http://blog.liuyixi.com/2011/09/09/add-onsdkguanyucontentscirptdeyixie/#comments</comments><guid isPermaLink="false">http://blog.liuyixi.com/?p=962</guid><dc:creator>一兮</dc:creator><fs:srclink>http://blog.liuyixi.com/2011/09/09/add-onsdkguanyucontentscirptdeyixie/</fs:srclink><fs:srcfeed>http://yixi.info/index.php/feed</fs:srcfeed><fs:itemid>feedsky/liuyixi/~8046913/626355357/5368011</fs:itemid></item></channel></rss>
