<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title><![CDATA[Fdream's Blog]]></title><link>http://fdream.net/blog/</link><description><![CDATA[Fdream的blog，关注互联网，专注前端开发，RIA，AJAX，Silverlight，Flash，Flex，ActionScript，JavaScript]]></description><language>zh-cn</language><copyright>Copyright 2005-2009, Fdream All Rights Reserved</copyright><webMaster>fdream@live.com</webMaster><image><title><![CDATA[Fdream's Blog]]></title><url>http://fdream.net/blog/images/logo.gif</url><link>http://fdream.net/blog/</link><description><![CDATA[Fdream的blog，关注互联网，专注前端开发，RIA，AJAX，Silverlight，Flash，Flex，ActionScript，JavaScript]]></description></image><item>
<link>http://fdream.net/blog/article/703.aspx</link>
<title><![CDATA[最新版flashplayer 10.1可能存在的一个安全问题bug]]></title>
<author>Fdream</author>
<category>Flash</category>
<pubDate>Tue, 17 Aug 2010 01:34:09 +0800</pubDate>
<lastBuildDate>Tue, 17 Aug 2010 02:36:35 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/703.aspx</guid>
<description><![CDATA[<p>最近flashplayer 10.1升级到了10.1.82.76，由于该版本在安全性控制方面做了许多改进，导致出现了如下的问题。</p><p>在Firefox或者Chrome浏览器下，当跨域向远程服务器请求数据时，如果URL使用的是GBK编码的，那么即使在远程服务器上有安全策略控制文件，仍然会引发安全错误。而同样的服务器，使用UTF8或者纯ASCII码做URL则不存在此问题。</p><p>也有人发现了相同的问题：<a href="http://forums.adobe.com/thread/699750?tstart=0" target="_blank">http://forums.adobe.com/thread/699750?tstart=0</a>。</p><p>此问题已提交至Adobe Flash Player Bug跟踪系统中，等待响应。</p><p>因此，建议大家尽量不要使用中文名作为URL路径，能使用英文字符的尽量使用英文字符，虽然有时候是难看一点。</p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/703.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/703.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/702.aspx</link>
<title><![CDATA[Merpressor —— 在线自动合并、压缩JS文件]]></title>
<author>Fdream</author>
<category>Ajax Web</category>
<pubDate>Thu, 12 Aug 2010 21:34:12 +0800</pubDate>
<lastBuildDate>Thu, 12 Aug 2010 21:40:46 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/702.aspx</guid>
<description><![CDATA[<p>最近工作稍微空了点，正好又有幸见到了盛大的在线合并工具，于是一时兴起，把YUI Compressor改造了一下，写了个在线合并JS和CSS的工具，命名为Merpressor，目前已经在工作中使用了。</p><p>Mepressor分为两个部分：一部分为公网发布时所用，使用Java编写；另一部分为本地调试时所用，使用轻量和方便的PHP编写。（似乎很绕，简单地讲：Java版本用来公网部署，合并同时压缩代码；PHP版用来本地测试，并不压缩内容。）</p><p>在项目中需要合并多个js文件或者css文件时，前端开发者只需修改一个xml格式的配置文件，指定需要合并的文件，通过一定的规则访问，服务器则可自动合并多个js文件，并使用YUI Compressor压缩后返回相应内容，而本地环境下，则会自动导入xml中指定的多个js文件或者css文件，从而使得开发调试和发布一体化，真正做到无缝切换。</p><p>注意： 由于合并和压缩需要花费较大的资源和时间，因此在响应速度和并发上会表现较差，在实际使用过程中，需要配合CDN（内容分发网络，一般中大型网站都会采用）使用。当然，你也可以只是把这个工具当合并压缩工具使用。</p><p>具体详细的使用方法和安装步骤、安装包下载及源码请移步至<a href="http://code.google.com/p/merpressor/" target="_blank">Google Code（项目托管地址）</a>，欢迎反馈bug及提出更好的想法和建议。</p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/702.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/702.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/701.aspx</link>
<title><![CDATA[在弹出窗口用POST提交数据]]></title>
<author>Fdream</author>
<category>Ajax Web</category>
<pubDate>Mon, 22 Feb 2010 08:19:08 +0800</pubDate>
<lastBuildDate>Mon, 22 Feb 2010 08:36:02 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/701.aspx</guid>
<description><![CDATA[<p>话说离上一篇日志的发表时间已有漫长的四个多月，实在是对不住读者。客观原因找一下，但是还是要实事求是：一是因为工作实在是太忙太累，无暇顾及；二是BLOG系统太慢，从前到后都需要大概，在开忙之前想修改BLOG系统来着，结果改了一点点就开始忙得不可开交了，于是也中止了。</p><p>春节休息了几天，今天上班第一天，最近混<a href="http://twitter.com" target="_blank">twitter</a>混得比较多，经常要压缩URL，以前做了个<a href="http://fdream.net/blog/article/692.aspx" target="_blank">书签</a>用<a href="http://is.gd/" target="_blank">http://is.gd/</a>压缩，后来发现了全球最短的URL——<a href="http://to./" target="_blank">http://to./</a>，于是决定换API压缩。以前的API可以用GET方式提交数据压缩，但是这个却需要用POST方式提交，因此需要在弹出窗口的同时用POST提交数据。实现起来很简单：在弹出窗口中生成一个表单，把value写到对应的字段中，打开弹出窗口后再用js提交表单即可。</p><p>代码如下：</p><p></p><div class="code_head" codeid="1">参考代码：&nbsp;<a href="javascript:void(0)" action="copy" title="copy the codes">[复制代码]</a>&nbsp;<a href="javascript:void(0)" action="save" title="save the codes">[保存代码]</a></div><div type="javascript" class="code_main" id="code1"><br />javascript:&nbsp;void(function()&nbsp;{<br />	var&nbsp;p&nbsp;=&nbsp;'http://to./',<br />	u&nbsp;=&nbsp;location.href,<br />	x&nbsp;=&nbsp;function()&nbsp;{<br />		s&nbsp;=&nbsp;'&lt;form&nbsp;name=&quot;f&quot;&nbsp;id=&quot;f&quot;&nbsp;action=&quot;'&nbsp;+&nbsp;p&nbsp;+&nbsp;'&quot;&nbsp;method=&quot;post&quot;&gt;&lt;input&nbsp;type=&quot;text&quot;&nbsp;name=&quot;url&quot;&nbsp;size=&quot;9&quot;&nbsp;maxlength=&quot;999&quot;&nbsp;value=&quot;'&nbsp;+&nbsp;u&nbsp;+&nbsp;'&quot;&nbsp;/&gt;&lt;/form&gt;&lt;script&nbsp;type=&quot;text/javascript&quot;&gt;document.f.submit();&lt;/script&gt;';<br />		w&nbsp;=&nbsp;window.open('',&nbsp;'W',&nbsp;'toolbar=0,resizable=1,scrollbars=no,status=1,width=320,height=240');<br />		w.document.write(s);<br />		if&nbsp;(!w)&nbsp;location.href&nbsp;=&nbsp;p&nbsp;+&nbsp;'?url='&nbsp;+&nbsp;encodeURIComponent(location.href);<br />	};<br />	if&nbsp;(/Firefox/.test(navigator.userAgent))&nbsp;{<br />		setTimeout(x,&nbsp;0)<br />	}&nbsp;else&nbsp;{<br />		x()<br />	}<br />})()<br /></div><p></p><p></p><p>使用方法很简单:</p><p>1.先把当前页面加入书签，然后修改书签的属性，更改链接名称，然后更改链接地址为：</p><p></p><div class="code_head" codeid="2">参考代码：&nbsp;<a href="javascript:void(0)" action="copy" title="copy the codes">[复制代码]</a>&nbsp;<a href="javascript:void(0)" action="save" title="save the codes">[保存代码]</a></div><div type="javascript" class="code_main" id="code2"><br />javascript:void(function(){var&nbsp;p='http://to./',u=location.href,x=function(){s='&lt;form&nbsp;name=&quot;f&quot;&nbsp;id=&quot;f&quot;&nbsp;action=&quot;'+p+'&quot;&nbsp;method=&quot;post&quot;&gt;&lt;input&nbsp;type=&quot;text&quot;&nbsp;name=&quot;url&quot;&nbsp;size=&quot;9&quot;&nbsp;maxlength=&quot;999&quot;&nbsp;value=&quot;'+u+'&quot;&nbsp;/&gt;&lt;/form&gt;&lt;script&nbsp;type=&quot;text/javascript&quot;&gt;document.f.submit();&lt;/script&gt;';w=window.open('','W','toolbar=0,resizable=1,scrollbars=no,status=1,width=320,height=240');w.document.write(s);if(!w)location.href=p+'?url='+encodeURIComponent(location.href);};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,&nbsp;0)}else{x()}})()<br /></div><p></p><p></p><p>2.打开你要压缩URL的页面，在书签栏点击这个书签，按下Ctrl + C复制就可以了，方便吧？</p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/701.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/701.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/700.aspx</link>
<title><![CDATA[Windows 7边栏小工具-Gmail Notifier-查收Gmail]]></title>
<author>Fdream</author>
<category>Ajax Web</category>
<pubDate>Thu, 08 Oct 2009 07:21:46 +0800</pubDate>
<lastBuildDate>Thu, 08 Oct 2009 07:27:11 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/700.aspx</guid>
<description><![CDATA[<p>国庆呆着无聊的时候，折腾了个Windows 7的边栏小工具，用来及时查收Gmail，可自定义收取时间间隔，预览Gmail邮件内容，有新邮件时会有提示音通知。截图如下：</p><p>呆在边栏时的状态：</p><p><img src="http://fdream.net/blog/Attachments/2009/10/p1uoz2_1.jpg" onload="ImageViewer.preProcess(this);" /></p><p></p><p>预览Gmail邮件：</p><p><img src="http://fdream.net/blog/Attachments/2009/10/9weu8i_2.jpg" onload="ImageViewer.preProcess(this);" /></p><p></p><p>参数设置：</p><p><img src="http://fdream.net/blog/Attachments/2009/10/oba5m9_3.jpg" onload="ImageViewer.preProcess(this);" /></p><p></p><p>工具下载地址：</p><p><a href="http://fdream.net/blog/Attachments/2009/10/tvmkxc_GmailNotifier.zip" target="_blank">点击此处下载</a></p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/700.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/700.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/699.aspx</link>
<title><![CDATA[不安全的js写法]]></title>
<author>Fdream</author>
<category>Ajax Web</category>
<pubDate>Fri, 11 Sep 2009 00:05:20 +0800</pubDate>
<lastBuildDate>Fri, 11 Sep 2009 00:18:36 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/699.aspx</guid>
<description><![CDATA[<p>一种很常见的写法：</p><p></p><div class="code_head" codeid="3">参考代码：&nbsp;<a href="javascript:void(0)" action="copy" title="copy the codes">[复制代码]</a>&nbsp;<a href="javascript:void(0)" action="save" title="save the codes">[保存代码]</a></div><div type="javascript" class="code_main" id="code3"><br />document.write('&lt;scr'+'ipt&nbsp;src=&quot;http://a.com/b.js&quot;&nbsp;type=&quot;text/javascript&quot;&gt;&lt;/scr'+'ipt&gt;');<br /></div><p></p><p></p><p>直到被杀毒软件提示有恶意代码才发现这也是不安全的，汗……</p><p>那就只好改成这样了：</p><p></p><div class="code_head" codeid="4">参考代码：&nbsp;<a href="javascript:void(0)" action="copy" title="copy the codes">[复制代码]</a>&nbsp;<a href="javascript:void(0)" action="save" title="save the codes">[保存代码]</a></div><div type="javascript" class="code_main" id="code4"><br />(function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;s&nbsp;=&nbsp;document.createElement('script');<br />&nbsp;&nbsp;&nbsp;&nbsp;s.type&nbsp;=&nbsp;'text/javascript';<br />&nbsp;&nbsp;&nbsp;&nbsp;s.src&nbsp;=&nbsp;'http://a.com.cn/b.js';<br />&nbsp;&nbsp;&nbsp;&nbsp;document.getElementsByTagName('head')[0].appendChild(s);<br />})();<br /></div><p></p><p></p><p>搜了一下，原来还有“邪恶”的eval，具体可以看这里：<a href="http://bbs.ikaka.com/showtopic-8625758.aspx" target="_blank">网马解密大讲堂——网马解密中级篇(Document.write篇)</a>。</p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/699.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/699.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/698.aspx</link>
<title><![CDATA[全新极速CSS选择器引擎whiz]]></title>
<author>Fdream</author>
<category>Ajax Web</category>
<pubDate>Fri, 21 Aug 2009 03:31:30 +0800</pubDate>
<lastBuildDate>Fri, 21 Aug 2009 03:47:49 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/698.aspx</guid>
<description><![CDATA[<p>好不容易有些空余时间，便拿来写自己的CSS选择器引擎了，这个CSS选择器引擎的目标只有三个：</p><p></p><ul  style="list-style-type:decimal"><li>速度要快</li><li>代码要精简</li><li>要支持CSS3的选择器。</li></ul><p></p><p></p><p>希望通过这个，能够真正理解那些牛逼的框架中的一部分，比如jQuery，Mootools，YUI等等。花了接近三个星期的时间，大重构了三遍，从最开始的速度极低到现在的极速，每一次都是大换血。在这个过程中，我看到了那些大师写代码的境界，即使我完成了这样一个东西，代码依然很难看。</p><p>大家可能看完性能测试才会有兴趣，下图是一个较全的性能测试结果，大家可以<a href="http://fdream.net/lib/jui/speed/" target="_blank">在这里测试</a>，大家可以自己跑一跑看（由于加载的东西较多，请耐心等待一会儿再点start按钮）。</p><p><img src="http://fdream.net/blog/Attachments/2009/08/_js.gif" onload="ImageViewer.preProcess(this);" /></p><p></p><p>代码量目前还没达到我满意的程度，不过已经足够小了，Gzip之后仅仅只有2KB（YUICompressor压缩之后为8.61K（win NTFS）），另外，针对Firefox 3， Opera 9性能还有很大的提升空间，因为我没有使用document.getElementsByClassName。但是这些优化在我看来不再是必要的，因为Firefox的用户应该会很快升级到Firefox 3.5，Opera 10也会很快变成正式版，它们都有本地方法querySelectorAll，所以只要选择器引擎在IE6和IE7下的性能达到最高就可以了，其他的浏览器都有本地方法querySelectorAll了。</p><p>在写这个选择器引擎的过程中，更进一步了解了js性能优化的更多方法。</p><p>另外，人力有限，此选择器引擎未经过足够完整的案例测试，如果有谁有兴趣帮忙测试者，可以和我联系向我索要源代码，等稳定性达到一定程度后会全面开放源代码。</p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/698.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/698.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/697.aspx</link>
<title><![CDATA[微软太执着，你不喜欢IE8那我就给你IE7]]></title>
<author>Fdream</author>
<category>乱弹IT</category>
<pubDate>Thu, 25 Jun 2009 20:16:53 +0800</pubDate>
<lastBuildDate>Thu, 25 Jun 2009 20:25:08 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/697.aspx</guid>
<description><![CDATA[<p>我有一个XP的系统，非常干净，IE6也一直没更新，留着原版测试CSS和JS。昨天早上开机提示要我安装更新，于是确定安装，结果蹦出个IE8的安装界面，吓了一跳。还好是第一步，可以不安装，于是点了不安装。图如下：</p><p><img src="http://fdream.net/blog/Attachments/2009/06/gl3rjx_ie8.gif" onload="ImageViewer.preProcess(this);" /></p><p></p><p>今天早上来开机，发现又有更新，于是继续装，结果今天蹦出个IE7的安装界面，雷啊！不过还是没装：</p><p><img src="http://fdream.net/blog/Attachments/2009/06/iuvtdq_ie7.gif" onload="ImageViewer.preProcess(this);" /></p><p></p><p>为什么都在Windows Update里面推荐更高版本的浏览器了，还存在这么多IE6呢？不要告诉我都和我一样，我很少用IE的，IE6就更不用了……</p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/697.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/697.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/696.aspx</link>
<title><![CDATA[背景图片千万不要gzip压缩，尤其是PNG]]></title>
<author>Fdream</author>
<category>Ajax Web</category>
<pubDate>Thu, 18 Jun 2009 03:11:47 +0800</pubDate>
<lastBuildDate>Thu, 18 Jun 2009 03:49:05 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/696.aspx</guid>
<description><![CDATA[<p>我们网站的静态资源（css、js和背景图片）和web应用程序是分开部署的，几乎所有的静态资源都部署在同一个应用下。最开始的网站很简单，对所有的静态资源都进行了gzip，包括所有的css，js，图片，flash等等，也一直相安无事。</p><p>直到……直到有一天用了png做背景图片，并且上传到服务器进行部署，发现在很多IE6都会在这个页面卡死，无法动弹，出事的几率非常的高。但是在内网部署的没有任何问题，那问题就只能比较内网和公网的服务器环境了。观察HTTP请求头部是个不错的方法，很快锁定是由于gzip的png引起的。内网服务器加上gzip测试，果然如此。</p><p>其实对图片等文件进行gzip是完全没有必要的，原因很简单：在web里面用作背景的图片99%以上都是gif或者jpg或者png，这些格式本来就是压缩过的，再用gzip对他们进行压缩只是徒增服务器负担而已。</p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/696.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/696.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/695.aspx</link>
<title><![CDATA[更新Twitter的几种方法]]></title>
<author>Fdream</author>
<category>乱弹IT</category>
<pubDate>Wed, 03 Jun 2009 00:41:24 +0800</pubDate>
<lastBuildDate>Wed, 03 Jun 2009 00:58:42 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/695.aspx</guid>
<description><![CDATA[<p>万恶的GFW，只要“国际互联网”还没有完全变成“国际不联网”，更新twitter的方法总是有的，目前知道的几个方式：</p><p><h3>1.用Gmail更新</h3></p><p></p><p>如果你有Gmail，请登录你的Gmail，点击“settings”（设置），如果你是中文版的Gmail，需要在“常规”选项卡里面更改显示语言为英语。切换到“Gadgets”选项，在“Add a gadget by its URL:”下面的文本框中输入下面的地址：</p><p></p><div class="quote_head">引用内容：</div><div class="quote_main"></p><p>http://twittergadget.appspot.com/gadget/gadget-gmail.xml</p><p></div><p></p><p></p><p>然后点击“Add”按钮，在左侧就可以看到“Twitter”了，使用你的Twitter帐号登录就可以了。</p><p><h3>2.代理网站</h3></p><p></p><p>目前发现比较好的网站有这几个：</p><p></p><ul  style="list-style-type:disc"><li><a href="http://cafebeta.com/twitter/" target="_blank">http://cafebeta.com/twitter/</a></li><li><a href="http://itweet.net/web/" target="_blank">http://itweet.net/web/</a></li><li><a href="http://m.tweete.net/login" target="_blank">http://m.tweete.net/login</a></li><li><a href="http://twitzap.com/" target="_blank">http://twitzap.com/</a></li><li><a href="http://tweetree.com/" target="_blank">http://tweetree.com/</a></li><li><a href="https://filttr.com/" target="_blank">https://filttr.com/</a></li></ul><p></p><p></p><p><h3>3.设代理服务器</h3></p><p></p><p>这里有一些翻墙代理：</p><p><a href="http://www.39proxy.com/ip.html" target="_blank">http://www.39proxy.com/ip.html</a></p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/695.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/695.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
<item>
<link>http://fdream.net/blog/article/694.aspx</link>
<title><![CDATA[Twitter、Flickr、Bing等被封]]></title>
<author>Fdream</author>
<category>乱弹IT</category>
<pubDate>Tue, 02 Jun 2009 21:41:23 +0800</pubDate>
<lastBuildDate>Tue, 02 Jun 2009 22:04:43 +0800</lastBuildDate>
<guid>http://fdream.net/blog/article/694.aspx</guid>
<description><![CDATA[<p>没有意思，也不想多说。</p><p>贴两张图吧，不过为了避免不必要的牺牲，这个图可能还得您手动点一下。</p><p><a href="http://img99.imageshack.us/img99/5012/shabi1.jpg" target="_blank">图片一</a></p><p></p><p><a href="http://img99.imageshack.us/img99/3159/shabi2.jpg" target="_blank">图片二</a></p><p></p>]]><p>您可以<a href="http://fdream.net/blog/article/694.aspx" target="_blank">在我的blog上阅读全文</a>并<b><a href="http://fdream.net/blog/article/694.aspx#comments" target="_blank">发表评论</a></b></p></description>
</item>
</channel></rss>