<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>守望轩 &#187; IE</title> <atom:link href="http://www.watch-life.net/tag/ie/feed" rel="self" type="application/rss+xml" /><link>http://www.watch-life.net</link> <description>关注IT,审视自我,守望生活, 宁静雅致的小轩馆.</description> <lastBuildDate>Wed, 08 Sep 2010 16:03:38 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>web developer tips (51):使用vs2005和IE8进行调试</title><link>http://www.watch-life.net/visual-studio/use-vs2005-to-debug-with-ie8.html</link> <comments>http://www.watch-life.net/visual-studio/use-vs2005-to-debug-with-ie8.html#comments</comments> <pubDate>Thu, 24 Sep 2009 16:01:42 +0000</pubDate> <dc:creator>xjb</dc:creator> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[debug]]></category> <category><![CDATA[IE]]></category> <category><![CDATA[vs2005]]></category> <category><![CDATA[web developer tips]]></category> <category><![CDATA[调试]]></category><guid
isPermaLink="false">http://www.watch-life.net/?p=452</guid> <description><![CDATA[原文地址： how to use VS2005 to debug with IE8 由于IE8默认设置下的散偶合功能，导致vs2005不能通过IE8进行调试。如果想启动调试（debug），请按如下步骤操作： 1、打开注册表编辑器 2、打开键 HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main 3、增加一个名为“ TabProcGrowth ”的dword 值 4、设置“ TabProcGrowth ”的值为0 同时，在调试的时候，不要忘记启动脚本调试功能（IE菜单：工具+选项+高级，不选中“禁用脚本功能(Internet Explorer)”）。 另：不能调试也可能是IE增强安全配置导致的，参见：脚本远程调试需关闭IE增强安全配置 你可能也会喜欢以下文章： web developer tips (52):部署Asp.net web应用须设置debug为false (0) web developer tips (65): 快速创建一个挂接SQL表的GridView (0) web developer tips (11):在Visual Web Developer中用不同的工具窗口打开样式生成器 (0) web developer tips [...]]]></description> <content:encoded><![CDATA[<p>原文地址： <a
href="http://blogs.msdn.com/webdevelopertips/archive/2009/03/31/tip-51-did-you-know-how-to-use-vs2005-to-debug-with-ie8.aspx" target="_blank">how to use VS2005 to debug with IE8</a></p><p>由于IE8默认设置下的<a
href="http://blogs.msdn.com/ie/archive/2008/03/11/ie8-and-loosely-coupled-ie-lcie.aspx" target="_blank">散偶合功能</a>，导致vs2005不能通过IE8进行调试。如果想启动调试（debug），请按如下步骤操作：</p><p>1、打开注册表编辑器<br
/> 2、打开键 HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main<br
/> 3、增加一个名为“ TabProcGrowth ”的dword 值<br
/> 4、设置“ TabProcGrowth ”的值为0</p><p>同时，在调试的时候，不要忘记启动脚本调试功能（IE菜单：工具+选项+高级，不选中“禁用脚本功能(Internet Explorer)”）。</p><p>另：不能调试也可能是IE增强安全配置导致的，参见：<a
href="http://www.watch-life.net/visual-studio/turning-off-ie-s-enhanced-security-configuration.html" target="_blank">脚本远程调试需关闭IE增强安全配置</a></p><p
class="akst_link"></p><h4>你可能也会喜欢以下文章：</h4><ul
class="st-related-posts"><li><a
href="http://www.watch-life.net/visual-studio/deploying-your-asp-net-web-application-debug-false-should-be-set-in-web-config.html" title="web developer tips (52):部署Asp.net web应用须设置debug为false (2009-09-27)">web developer tips (52):部署Asp.net web应用须设置debug为false</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html" title="web developer tips (65): 快速创建一个挂接SQL表的GridView (2009-11-19)">web developer tips (65): 快速创建一个挂接SQL表的GridView</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/new-style-builder-can-be-invoked-from-various-other-tool-windows-in-visual-web-developer.html" title="web developer tips (11):在Visual Web Developer中用不同的工具窗口打开样式生成器 (2009-06-25)">web developer tips (11):在Visual Web Developer中用不同的工具窗口打开样式生成器</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html" title="web developer tips (5):绑定ListView控件 (2009-06-12)">web developer tips (5):绑定ListView控件</a> (1)</li><li><a
href="http://www.watch-life.net/visual-studio/iis-search-engine-optimization-seo-toolkit.html" title="web developer tips (73): IIS搜索引擎优化工具包 (2010-01-13)">web developer tips (73): IIS搜索引擎优化工具包</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/create-an-iis-virtual-directory-from-within-visual-web-developer.html" title="web developer tips (12):在Visual Web Developer里创建IIS虚拟目录 (2009-06-26)">web developer tips (12):在Visual Web Developer里创建IIS虚拟目录</a> (0)</li><li><a
href="http://www.watch-life.net/vs2005/vs2005-tools-lost.html" title="vs2005 工具箱控件消失的解决办法 (2007-02-01)">vs2005 工具箱控件消失的解决办法</a> (1)</li><li><a
href="http://www.watch-life.net/visual-studio/enable-debugging-of-your-web-site.html" title="web developer tips (14):启动网站调试 (2009-07-02)">web developer tips (14):启动网站调试</a> (1)</li></ul>转载请注明作者，出处，以及原始超链接。<br
/>评论数：0 | <b><a
href='http://www.watch-life.net/visual-studio/use-vs2005-to-debug-with-ie8.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a
href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a
href='http://www.watch-life.net/visual-studio/use-vs2005-to-debug-with-ie8.html'>www.watch-life.net</a>]]></content:encoded> <wfw:commentRss>http://www.watch-life.net/visual-studio/use-vs2005-to-debug-with-ie8.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>兼容多种浏览器“复制到剪贴板”的解决方案</title><link>http://www.watch-life.net/javascript/copy-to-clipboard-solution.html</link> <comments>http://www.watch-life.net/javascript/copy-to-clipboard-solution.html#comments</comments> <pubDate>Thu, 05 Mar 2009 03:10:00 +0000</pubDate> <dc:creator>xjb</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[clipboard]]></category> <category><![CDATA[copy to clipboard]]></category> <category><![CDATA[FireFox]]></category> <category><![CDATA[IE]]></category> <category><![CDATA[Opera]]></category> <category><![CDATA[Safari]]></category> <category><![CDATA[剪贴板]]></category> <category><![CDATA[浏览器]]></category><guid
isPermaLink="false">http://www.watch-life.net/javascript/copy-to-clipboard-solution.html</guid> <description><![CDATA[昨天在也一个php程序的时候，要实现“复制到剪贴板”的功能，安全问题，浏览器的限制越来越严，实现的方法也越来越有限，这个简单的功能要想实现兼容不同的浏览器还真不容易，根据网上的一些资料结合我测试的经验，相关解决方案如下： 方案一：利用“window.clipboardData” 代码示例： if (window.clipboardData) { window.clipboardData.clearData(); window.clipboardData.setData(&#34;Text&#34;, txt) }; 评论：这个方案只适合IE浏览器，同时在IE7下有个如下安全提示的对话框。 由于IE的浏览器的占有率比较大，这个方案是使用最广的，也是最简单的方法。 支持浏览器：IE5.5 IE6.0 IE7.0 方案二：利用“Components.interfaces.nsIClipboard” 代码示例： if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege(&#34;UniversalXPConnect&#34;); } catch (e) { if (flag == 0) { alert(&#34;You are using the Firefox browser, copy the function browser refuse！\nPlease in the browser address bar enter'about:config' and Enter \n and set'signed.applets.codebase_principal_support' to [...]]]></description> <content:encoded><![CDATA[<p>昨天在也一个<a
href="http://www.watch-life.net/tag/php" target="_blank">php</a>程序的时候，要实现“复制到剪贴板”的功能，安全问题，浏览器的限制越来越严，实现的方法也越来越有限，这个简单的功能要想实现兼容不同的浏览器还真不容易，根据网上的一些资料结合我测试的经验，相关解决方案如下：</p><h2>方案一：利用“window.clipboardData”</h2><p><strong>代码示例：</strong></p><p> <code><div
class="code"><span
style="color: blue">if </span>(window.clipboardData) {<br
/> window.clipboardData.clearData();<br
/> window.clipboardData.setData(<span
style="color: #a31515">&quot;Text&quot;</span>, txt)</p><p>};</p></div><p> <strong>评论：</strong>这个方案只适合IE浏览器，同时在IE7下有个如下安全提示的对话框。</p><p><a
href="http://www.watch-life.net/images/2009/03/image.png"><img
title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="154" alt="image" src="http://www.watch-life.net/images/2009/03/image-thumb.png" width="375" border="0" /></a></p><p> 由于<a
href="http://www.microsoft.com/china/windows/products/winfamily/ie/default.mspx" target="_blank">IE</a>的浏览器的占有率比较大，这个方案是使用最广的，也是最简单的方法。</p><p><strong>支持浏览器：IE5.5 IE6.0 IE7.0</strong></p><h2>方案二：利用“Components.interfaces.nsIClipboard”</h2><p><strong>代码示例：</strong></p><div
class="code"><span
style="color: blue">if </span>(window.netscape) {<br
/> <span
style="color: blue">try </span>{<br
/> netscape.security.PrivilegeManager.enablePrivilege(<span
style="color: #a31515">&quot;UniversalXPConnect&quot;</span>);<br
/> } <span
style="color: blue">catch </span>(e) {<br
/> <span
style="color: blue">if </span>(flag == 0) {<br
/> alert(<span
style="color: #a31515">&quot;You are using the Firefox browser, copy the function browser refuse！<br/>\nPlease in the browser address bar enter'about:config' and Enter \n and set'signed.applets.codebase_principal_support' to 'true'&quot;</span>);</p><p> } <span
style="color: blue">else </span>{<br
/> alert(<span
style="color: #a31515">&quot;你使用的是Firefox 浏览器,复制功能被浏览器拒绝！\n请在浏览器地址栏输入'about:config'<br/>并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'&quot;</span>);</p><p> }<br
/> }<br
/> <span
style="color: blue">var </span>clip = Components.classes[<span
style="color: #a31515">'@mozilla.org/widget/clipboard;1'</span>].createInstance<br/>(Components.interfaces.nsIClipboard);<br
/> <span
style="color: blue">if </span>(!clip)<br
/> <span
style="color: blue">return</span>;<br
/> <span
style="color: blue">var </span>trans = Components.classes[<span
style="color: #a31515">'@mozilla.org/widget/transferable;1'</span>].createInstance<br/>(Components.interfaces.nsITransferable);<br
/> <span
style="color: blue">if </span>(!trans)<br
/> <span
style="color: blue">return</span>;<br
/> trans.addDataFlavor(<span
style="color: #a31515">'text/unicode'</span>);<br
/> <span
style="color: blue">var </span>str = <span
style="color: blue">new </span>Object();<br
/> <span
style="color: blue">var </span>len = <span
style="color: blue">new </span>Object();<br
/> <span
style="color: blue">var </span>str = Components.classes[<span
style="color: #a31515">&quot;@mozilla.org/supports-string;1&quot;</span>].createInstance<br/>(Components.interfaces.nsISupportsString);<br
/> <span
style="color: blue">var </span>copytext = txt;<br
/> str.data = copytext;<br
/> trans.setTransferData(<span
style="color: #a31515">&quot;text/unicode&quot;</span>, str, copytext.length * 2);<br
/> <span
style="color: blue">var </span>clipid = Components.interfaces.nsIClipboard;<br
/> <span
style="color: blue">if </span>(!clip)<br
/> <span
style="color: blue">return false</span>;<br
/> clip.setData(trans, <span
style="color: blue">null</span>, clipid.kGlobalClipboard);</p><p>}</p></div><p><strong>评论：</strong>这个方案只适合Firefox,同时也有安全的问题，如果想使用这个方法，必须手动开启Firefox的一个配置：signed.applets.codebase_principal_support。方法是：在地址栏输输入“about:config”,设置“signed.applets.codebase_principal_support”为<font
color="#ff0000">true</font>，默认该项是<font
color="#ff0000">false</font>。</p><p><a
href="http://www.watch-life.net/images/2009/03/image1.png"><img
title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="49" alt="image" src="http://www.watch-life.net/images/2009/03/image-thumb1.png" width="684" border="0" /></a></p></p><p>这个方法虽然可以在<a
href="http://www.mozillaonline.com/" target="_blank">Firefox</a>使用，但让一个普通用户去开启这个配置似乎太专业了。</p><p>把这个方案和方案一结合，可以适用80%以上的用户。</p><p><strong>支持浏览器：</strong>Firefox1.5&#160; firefox2.0&#160; firefox3.0</p><h2>方案三：javascript + flash</h2><p><strong>代码示例：</strong></p><div
class="code"><span
style="color: blue">var </span>flashcopier = <span
style="color: #a31515">'flashcopier'</span>;<br
/> <span
style="color: blue">if </span>(!document.getElementById(flashcopier)) {<br
/> <span
style="color: blue">var </span>divholder = document.createElement(<span
style="color: #a31515">'div'</span>);<br
/> divholder.id = flashcopier;<br
/> document.body.appendChild(divholder);<br
/> }<br
/> document.getElementById(flashcopier).innerHTML = <span
style="color: #a31515">''</span>;<br
/> <span
style="color: blue">var </span>divinfo = <span
style="color: #a31515">'&lt;embed src=&quot;clipboard.swf&quot; FlashVars=&quot;clipboard=' </span>+ text2copy + <span
style="color: #a31515">'&quot; <br/>width=&quot;0&quot; height=&quot;0&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;'</span>;</p><p> document.getElementById(flashcopier).innerHTML = divinfo;}</p></div><p><a
href="http://11011.net/software/vspaste"></a><strong>评论：</strong>这个方案是一个最流行的方法，著名的<a
href="http://www.jeffothy.com/weblog/clipboard-copy/" target="_blank">Clipboard Copy</a>解决方案 利用一个clipboard.swf作为桥梁，复制内容到剪贴板。原理是：创建一个隐藏的flash文件，同时给给flash的变量<font
color="#ff0000">FlashVars </font><font
color="#000000">赋值“clipboard=..”，通过这个赋值flash就会把复制的内容放到剪贴板。这个方法兼容IE、Firefox、<a
href="http://cn.opera.com/" target="_blank">Opera</a>、<a
href="http://www.google.com/chrome/index.html?hl=zh-CN" target="_blank">chrome</a>、 <a
href="http://www.apple.com.cn/safari/" target="_blank">Safari</a>，真可谓“万能”的解决方案。浏览器Flash的安装率非常高，这几乎是一个完美的解决方案。</font></p><p>clipboard.swf 的下载地址：<a
title="http://watch-life.googlecode.com/files/clipboard.swf" href="http://watch-life.googlecode.com/files/clipboard.swf">http://watch-life.googlecode.com/files/clipboard.swf</a>。</p><p><font
color="#000000">但是，世界上有完美的事么？这个方法只支持flash 9 ，不支持最新的flash 10。因为flash10中规定了只有在swf上进行了真实的操作（比如鼠标点击）才能访问剪切板，而上述方法只是使用了一个隐藏的swf文件，通过javascript操作flash的剪贴板，用户并没有对swf文件进行真实的操作，因此这个方法也就失效了。</font></p><p><font
color="#000000">那么如何解决这个“真实操作”的问题呢？可以使用一个JavaScript库：<a
href="http://code.google.com/p/zeroclipboard/"><strong>Zero Clipboard</strong></a>，利用这个js库可以支持利用flash 10 实现复制到剪贴板。这个方法原理是在一个透明的flash（对用户来说是不可见的）上覆盖一个dom元素比如button或div，当点击这个dom时，实际点击的是flash，从而访问flash的剪贴板。真够曲折的。:-)</font></p><p><font
color="#000000">具体的实现详见如下链接：</font></p><p>DEMO页面 :&#160; <a
href="http://bowser.macminicolo.net/~jhuckaby/zeroclipboard/">http://bowser.macminicolo.net/~jhuckaby/zeroclipboard/</a></p><p>Zero Clipboard项目主页： <a
href="http://code.google.com/p/zeroclipboard/">http://code.google.com/p/zeroclipboard/</a></p><p><strong>支持浏览器：</strong>Firefox1.5&#160; firefox2.0&#160; firefox3.0 IE5.5 IE6.0 IE 7.0 opera 8 opera 9 chorme 1.0 chorme 2.0 safari 3</p><p><font
color="#000000"></font></p><p
class="akst_link"></p><h4>你可能也会喜欢以下文章：</h4><ul
class="st-related-posts"><li><a
href="http://www.watch-life.net/visual-studio/use-vs2005-to-debug-with-ie8.html" title="web developer tips (51):使用vs2005和IE8进行调试 (2009-09-25)">web developer tips (51):使用vs2005和IE8进行调试</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/add-browsers-to-visual-web-developer-using-the-browse-with-option.html" title="web developer tips (4):在Visual Web Developer中增加浏览器 (2009-06-09)">web developer tips (4):在Visual Web Developer中增加浏览器</a> (3)</li><li><a
href="http://www.watch-life.net/googleapp/google-chrome-os-a-bit-disappointed.html" title="对Google chrome OS 有点失望 (2009-11-23)">对Google chrome OS 有点失望</a> (5)</li><li><a
href="http://www.watch-life.net/javascript/help-i-dont-know-javascript.html" title="帮帮我！我不懂JavaScript (2009-09-30)">帮帮我！我不懂JavaScript</a> (3)</li><li><a
href="http://www.watch-life.net/googleapp/common-google-chrome-objections.html" title="英文阅读：Matt Cutts关于google chrome常见疑问的回答 (2008-09-05)">英文阅读：Matt Cutts关于google chrome常见疑问的回答</a> (0)</li><li><a
href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html" title="让GridView中CheckBox列支持FireFox (2008-07-08)">让GridView中CheckBox列支持FireFox</a> (0)</li><li><a
href="http://www.watch-life.net/googleapp/google-chrome.html" title="Google Chrome 初试手记 (2008-09-03)">Google Chrome 初试手记</a> (3)</li><li><a
href="http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html" title="Google Chrome 会是IE的终结者么？ (2008-09-03)">Google Chrome 会是IE的终结者么？</a> (5)</li></ul>转载请注明作者，出处，以及原始超链接。<br
/>评论数：4 | <b><a
href='http://www.watch-life.net/javascript/copy-to-clipboard-solution.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a
href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a
href='http://www.watch-life.net/javascript/copy-to-clipboard-solution.html'>www.watch-life.net</a>]]></content:encoded> <wfw:commentRss>http://www.watch-life.net/javascript/copy-to-clipboard-solution.html/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Google Chrome 会是IE的终结者么？</title><link>http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html</link> <comments>http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html#comments</comments> <pubDate>Wed, 03 Sep 2008 14:04:58 +0000</pubDate> <dc:creator>xjb</dc:creator> <category><![CDATA[Google App]]></category> <category><![CDATA[FireFox]]></category> <category><![CDATA[google]]></category> <category><![CDATA[google chrome]]></category> <category><![CDATA[IE]]></category> <category><![CDATA[Opera]]></category> <category><![CDATA[Safari]]></category> <category><![CDATA[浏览器]]></category> <category><![CDATA[终结者]]></category><guid
isPermaLink="false">http://www.watch-life.net/?p=207</guid> <description><![CDATA[当我今天下载使用Google Chrome 的时候我的第一感觉：它是简约版的google风格的Safari，毕竟他们的内核引擎都是WebKit google这次高调杀入浏览器的市场的背景是：前几天Google刚刚和Mozilla续签了三年的合作协议。一方面借助firefox推广自己，一方面又开发自己的浏览器，看来是两手准备都有，用3年的时间来让Google Chrome的羽翼变得更丰满，同时让自己资助的firefox继续和IE进行正面战场的竞争。 我猜测，未来几年在浏览器市场，将会Google Chrome 、firefox 、IE 三分天下的竞争局面。 Google 提供为互联网而研发的浏览器，在速度、稳定、安全方面都有不错的表现，那么Google Chrome 会是IE的终结者么？恐怕下此结论还为时尚早，至少在中国会是这样。 1、自从IE7发布后，微软（microsoft）在IE研发力度不断加大，IE8将在不久发布。微软在操作系统的垄断地位，将会保证IE也会在未来的很长时间内保持绝对的占有率。 2、无论Firefox 还是Opera 或者Safari ,他们的使用者都是喜欢尝试新鲜的fans和开发者为主，大量的普通用户并不挑剔，只要简单的上网，IE足够了。 3、大量的企业级应用的用户仍然被锁定在IE上，从这个角度来看，抓住了企业级应用的开发者，就抓住了大量的用户。 4、目前的Google Chrome 还只具备基本的功能。对中国很多用户来说，无法正常使用网上银行、无法使用支付宝、QQ空间显示不正常(中国的qq用户可是海量级的)，将是阻碍用户使用Google Chrome重要因素之一。 5、尽管google 推广Chrome可以说是轻而易举的事情，尽管google可以把很多的应用都绑定在chrome上，对推广应用很有帮助，但这毕竟是小聪明，Google要真正实现云计算的野心，就不会拘泥一个浏览器。 Google不过是借chrome 之力为未来的发展拓展更大的空间。 ps：做个大胆的预测2011年后，Google chrome或许会成为Firefox的终结者？ 本文地址：http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html 你可能也会喜欢以下文章： Google将停止notebook的服务？ (4) 让GridView中CheckBox列支持FireFox (0) web developer tips (4):在Visual Web Developer中增加浏览器 (3) 兼容多种浏览器“复制到剪贴板”的解决方案 (4) google和baidu发布寻亲搜索 (0) 针对google 境外服务无法访问的临时解决方案 (1) 推荐一款专家级网站流量分析软件-逆火(Nihuo) (5) 听从心的选择 (9) 转载请注明作者，出处，以及原始超链接。评论数：5 [...]]]></description> <content:encoded><![CDATA[<p>当我今天下载使用<a
href="http://www.google.com/chrome/" target="_blank"><strong>Google Chrome</strong></a> 的时候我的第一感觉：它是简约版的google风格的<strong>Safari</strong>，毕竟他们的内核引擎都是<a
href="http://www.xiaohui.com/dev/server/20080903-webkit-opensource-project.htm" target="_blank">WebKit</a></p><p>google这次高调杀入浏览器的市场的背景是：前几天Google刚刚和Mozilla续签了三年的合作协议。一方面借助firefox推广自己，一方面又开发自己的浏览器，看来是两手准备都有，用3年的时间来让<strong>Google Chrome</strong>的羽翼变得更丰满，同时让自己资助的firefox继续和IE进行正面战场的竞争。</p><p>我猜测，未来几年在浏览器市场，将会<strong>Google Chrome</strong> 、<a
href="http://www.mozilla.com/firefox/" target="_blank"><strong>firefox</strong> </a>、<a
href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx" target="_blank"><strong>IE</strong></a> 三分天下的<a
href="http://googlechinablog.com/2008/09/chromium.html" target="_blank">竞争局面</a>。</p><p>Google 提供为<a
href="http://googlechinablog.com/2008/09/blog-post_9274.html" target="_blank">互联网而研发的浏览器</a>，在速度、稳定、安全方面都有不错的表现，那么Google Chrome 会是IE的<a
href="http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html" target="_blank">终结者</a>么？恐怕下此结论还为时尚早，至少在中国会是这样。</p><p>1、自从IE7发布后，<a
href="http://www.microsoft.com/" target="_blank"><strong>微软</strong>（microsoft</a>）在IE研发力度不断加大，<strong>IE8</strong>将在不久发布。微软在操作系统的垄断地位，将会保证IE也会在未来的很长时间内保持绝对的占有率。<br
/> 2、无论Firefox 还是<a
href="http://www.opera.com/" target="_blank">Opera </a>或者Safari ,他们的使用者都是喜欢尝试新鲜的fans和开发者为主，大量的普通用户并不挑剔，只要简单的上网，IE足够了。</p><p>3、大量的<strong>企业级应用</strong>的用户仍然被锁定在IE上，从这个角度来看，抓住了企业级应用的开发者，就抓住了大量的用户。</p><p>4、目前的Google Chrome 还只具备基本的功能。对中国很多用户来说，无法正常使用网上银行、无法使用支付宝、QQ空间显示不正常(中国的qq用户可是海量级的)，将是阻碍用户使用Google Chrome重要因素之一。</p><p>5、尽管google 推广Chrome可以说是轻而易举的事情，尽管google可以把很多的应用都绑定在chrome上，对推广应用很有帮助，但这毕竟是小聪明，Google要真正实现云计算的野心，就不会拘泥一个浏览器。</p><p>Google不过是借chrome 之力为未来的发展拓展更大的空间。</p><p>ps：做个大胆的预测2011年后，Google chrome或许会成为Firefox的终结者？</p><p>本文地址：<a
href="http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html" target="_blank">http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html</a></p><p
class="akst_link"></p><h4>你可能也会喜欢以下文章：</h4><ul
class="st-related-posts"><li><a
href="http://www.watch-life.net/googleapp/stopping-service-on-google-notebook.html" title="Google将停止notebook的服务？ (2009-01-18)">Google将停止notebook的服务？</a> (4)</li><li><a
href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html" title="让GridView中CheckBox列支持FireFox (2008-07-08)">让GridView中CheckBox列支持FireFox</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/add-browsers-to-visual-web-developer-using-the-browse-with-option.html" title="web developer tips (4):在Visual Web Developer中增加浏览器 (2009-06-09)">web developer tips (4):在Visual Web Developer中增加浏览器</a> (3)</li><li><a
href="http://www.watch-life.net/javascript/copy-to-clipboard-solution.html" title="兼容多种浏览器“复制到剪贴板”的解决方案 (2009-03-05)">兼容多种浏览器“复制到剪贴板”的解决方案</a> (4)</li><li><a
href="http://www.watch-life.net/life-thinking/google-baidu-search-qinren.html" title="google和baidu发布寻亲搜索 (2008-05-16)">google和baidu发布寻亲搜索</a> (0)</li><li><a
href="http://www.watch-life.net/it-review/visit-google-service.html" title="针对google 境外服务无法访问的临时解决方案 (2009-06-26)">针对google 境外服务无法访问的临时解决方案</a> (1)</li><li><a
href="http://www.watch-life.net/website-app/nihuo-professional-web-log-analytic.html" title="推荐一款专家级网站流量分析软件-逆火(Nihuo) (2009-02-02)">推荐一款专家级网站流量分析软件-逆火(Nihuo)</a> (5)</li><li><a
href="http://www.watch-life.net/life-thinking/follow-my-heart.html" title="听从心的选择 (2009-09-05)">听从心的选择</a> (9)</li></ul>转载请注明作者，出处，以及原始超链接。<br
/>评论数：5 | <b><a
href='http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a
href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a
href='http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html'>www.watch-life.net</a>]]></content:encoded> <wfw:commentRss>http://www.watch-life.net/googleapp/google-chrome-ie-terminator.html/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>让GridView中CheckBox列支持FireFox</title><link>http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html</link> <comments>http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html#comments</comments> <pubDate>Tue, 08 Jul 2008 09:48:39 +0000</pubDate> <dc:creator>xjb</dc:creator> <category><![CDATA[Asp.net]]></category> <category><![CDATA[CheckBox]]></category> <category><![CDATA[FireFox]]></category> <category><![CDATA[gridview]]></category> <category><![CDATA[IE]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[兼容]]></category><guid
isPermaLink="false">http://www.watch-life.net/?p=151</guid> <description><![CDATA[在Asp.net中，可以通过模板列，在Gridview中实现CheckBox列的实现，相关的代码并不复杂，你可以参考这里，我抽取的部分代码如下： &#60;script&#160;language=&#8221;javascript&#8221;&#160;type=&#8221;text/javascript&#8221;&#62;&#160;&#160;&#160;&#160;function&#160;selectAll(obj) &#160;&#160;&#160;{ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;theTable&#160;&#160;=&#160;obj.parentElement.parentElement.parentElement; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;i; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;j&#160;=&#160;obj.parentElement.cellIndex;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(i=0;i&#60;theTable.rows.length;i++) &#160;&#160;&#160;&#160;&#160;&#160;&#160;{ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;objCheckBox&#160;=&#160;theTable.rows[i].cells[j].firstChild; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(objCheckBox.checked!=null)objCheckBox.checked&#160;= &#160;&#160;&#160;&#160;&#60;/script&#62; &#60;asp:GridView&#160;ID=&#8221;GridView1&#8243;&#160;runat=&#8221;server&#8221;&#160;AllowPaging=&#8221;True&#34; &#160;AutoGenerateColumns=&#8221;False&#8221; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;DataKeyNames=&#8221;id&#8221;&#160;DataSourceID=&#8221;AccessDataSource1&#8243;&#160; AllowSorting=&#8221;True&#8221;&#160;OnDataBinding=&#8221;GridView1_DataBinding&#8221;&#160;OnRowDataBound=&#8221;GridView1_RowDataBound&#8221;&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;Columns&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;asp:TemplateField&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;ItemTemplate&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;asp:CheckBox&#160;ID=&#8221;CheckBox1&#8243;&#160;runat=&#8221;server&#8221;&#160;Checked=&#8221;True&#8221;&#160;Text=&#8217;&#60;%#DataBinder.Eval(Container.DataItem,&#8221;id&#8221;)&#160;%&#62;&#8217;&#160;/&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/ItemTemplate&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;HeaderTemplate&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#38;nbsp;&#60;input&#160;id=&#8221;CheckAll&#8221;&#160;type=&#8221;checkbox&#8221;&#160;onclick=&#8221;selectAll(this);&#8221;&#160;/&#62;全选&#160;&#160;&#160;&#160;&#60;/HeaderTemplate&#62;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;asp:BoundField&#160;DataField=&#8221;id&#8221;&#160;HeaderText=&#8221;id&#8221;&#160;InsertVisible=&#8221;False&#8221;&#160;ReadOnly=&#8221;True&#8221;&#160;&#160;&#160;&#160; &#160;SortExpression=&#8221;id&#8221;&#160;/&#62; &#160;&#160;&#60;asp:BoundField&#160;DataField=&#8221;name&#8221;&#160;HeaderText=&#8221;name&#8221;&#160;SortExpression=&#8221;name&#8221;&#160;/&#62;&#160; &#160;&#160;&#60;asp:BoundField&#160;DataField=&#8221;sex&#8221;&#160;HeaderText=&#8221;sex&#8221;&#160;SortExpression=&#8221;sex&#8221;&#160;/&#62;&#160; &#160;&#160;&#60;asp:BoundField&#160;DataField=&#8221;deptid&#8221;&#160;HeaderText=&#8221;deptid&#8221;&#160;SortExpression=&#8221;deptid&#8221;&#160;/&#62;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/Columns&#62;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/asp:GridView&#62;&#160;&#160; js代码中的selectAll(obj)方法在IE中可以正常使用。昨天，一朋友做测试，发现在FireFox中不支持，让我帮着找找原因，估计是js的代码有不兼容Firefox的，查有关资料，原来在firefox不支持parentElement，但支持parentNode，于是把原来的js代码修改了一下，通过obj.parentNode.parentNode.parentNode 来获取表格对象（GridView编译后形成的表格），不过要找到CheckBox对象要麻烦点，因为没法通过obj.parentElement.cellIndex 来定位找到ChecKbox所在位置了，只能通过循环某一行的单元格来查找了。具体的代码如下： function&#160;select_all(obj)&#160;&#160;&#160; {&#160;&#160;&#160; &#160;&#160;&#160;&#160;var&#160;theTable&#160;&#160;=&#160;obj.parentNode.parentNode.parentNode;&#160;&#160;&#160; &#160;&#160;&#160;&#160;var&#160;j&#160;=&#160;obj.parentNode.cellIndex;&#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160;&#160;for(var&#160;i=0;&#160;i&#60;theTable.rows.length;&#160;i++)&#160;&#160;&#160; &#160;&#160;&#160;&#160;{&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;objCheckBox&#160;=&#160;GetCheckBoxObj(theTable.rows[i].cells[j]);&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(objCheckBox.checked&#160;!=&#160;null)&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;objCheckBox.checked&#160;=&#160;obj.checked;&#160;&#160;&#160; &#160;&#160;&#160;&#160;}&#160;&#160;&#160; }&#160;&#160; function&#160;GetCheckBoxObj(objCell)&#160;&#160;&#160; {&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;for(var&#160;i=&#160;0;&#160;i&#160;&#60;&#160;objCell.childNodes.length;&#160;i++)&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(objCell.childNodes[i].id)&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;objCell.childNodes[i];&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&#160;&#160; }&#160;&#160;&#160; &#160;&#160; 如此修改后，这个checkbox就可以兼容IE和FireFox了。  [...]]]></description> <content:encoded><![CDATA[<p>在Asp.net中，可以通过模板列，在Gridview中实现CheckBox列的实现，相关的代码并不复杂，你可以参考<a
href="http://www.cnblogs.com/eddie005/archive/2006/07/04/442837.html">这里</a>，我抽取的部分代码如下：</p><div
class="code"><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">script&nbsp;</span><span
style="color: #ff0000">language</span><span
style="color: #0000ff">=&#8221;javascript&#8221;</span><span
style="color: #ff0000">&nbsp;type</span><span
style="color: #0000ff">=&#8221;text/javascript&#8221;</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff; background-color: #f5f5f5">function</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;selectAll(obj)<br
/> &nbsp;&nbsp;&nbsp;{<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff; background-color: #f5f5f5">var</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;theTable&nbsp;&nbsp;</span><span
style="color: #000000; background-color: #f5f5f5">=</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;obj.parentElement.parentElement.parentElement;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff; background-color: #f5f5f5">var</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;i;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff; background-color: #f5f5f5">var</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;j&nbsp;</span><span
style="color: #000000; background-color: #f5f5f5">=</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;obj.parentElement.cellIndex;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff; background-color: #f5f5f5">for</span><span
style="color: #000000; background-color: #f5f5f5">(i</span><span
style="color: #000000; background-color: #f5f5f5">=</span><span
style="color: #000000; background-color: #f5f5f5">0</span><span
style="color: #000000; background-color: #f5f5f5">;i</span><span
style="color: #000000; background-color: #f5f5f5">&lt;</span><span
style="color: #000000; background-color: #f5f5f5">theTable.rows.length;i</span><span
style="color: #000000; background-color: #f5f5f5">++</span><span
style="color: #000000; background-color: #f5f5f5">)<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff; background-color: #f5f5f5">var</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;objCheckBox&nbsp;</span><span
style="color: #000000; background-color: #f5f5f5">=</span><span
style="color: #000000; background-color: #f5f5f5">&nbsp;theTable.rows[i].cells[j].firstChild;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff; background-color: #f5f5f5">if</span><span
style="color: #000000; background-color: #f5f5f5">(objCheckBox.checked</span><span
style="color: #000000; background-color: #f5f5f5">!=</span><span
style="color: #0000ff; background-color: #f5f5f5">null</span><span
style="color: #000000; background-color: #f5f5f5">)objCheckBox.checked&nbsp;</span><span
style="color: #000000; background-color: #f5f5f5">=</span><span
style="color: #000000; background-color: #f5f5f5"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;/</span><span
style="color: #800000">script</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000"></p><p> </span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">asp:GridView&nbsp;</span><span
style="color: #ff0000">ID</span><span
style="color: #0000ff">=&#8221;GridView1&#8243;</span><span
style="color: #ff0000">&nbsp;runat</span><span
style="color: #0000ff">=&#8221;server&#8221;</span><span
style="color: #ff0000">&nbsp;AllowPaging</span><span
style="color: #0000ff">=&#8221;True&quot;</span><br/><br
/> <span
style="color: #ff0000">&nbsp;AutoGenerateColumns</span><span
style="color: #0000ff">=&#8221;False&#8221;</span><span
style="color: #ff0000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataKeyNames</span><span
style="color: #0000ff">=&#8221;id&#8221;</span><span
style="color: #ff0000">&nbsp;DataSourceID</span><span
style="color: #0000ff">=&#8221;AccessDataSource1&#8243;</span><span
style="color: #ff0000">&nbsp;</span><br/><br
/> <span
style="color: #ff0000">AllowSorting</span><span
style="color: #0000ff">=&#8221;True&#8221;</span><span
style="color: #ff0000">&nbsp;OnDataBinding</span><span
style="color: #0000ff">=&#8221;GridView1_DataBinding&#8221;</span><br/><span
style="color: #ff0000">&nbsp;OnRowDataBound</span><span
style="color: #0000ff">=&#8221;GridView1_RowDataBound&#8221;</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">Columns</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">asp:TemplateField</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">ItemTemplate</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">asp:CheckBox&nbsp;</span><span
style="color: #ff0000">ID</span><span
style="color: #0000ff">=&#8221;CheckBox1&#8243;</span><span
style="color: #ff0000">&nbsp;runat</span><span
style="color: #0000ff">=&#8221;server&#8221;</span><br/><span
style="color: #ff0000">&nbsp;Checked</span><span
style="color: #0000ff">=&#8221;True&#8221;</span><span
style="color: #ff0000">&nbsp;Text</span><span
style="color: #0000ff">=&#8217;&lt;%#DataBinder.Eval(Container.DataItem,&#8221;id&#8221;)&nbsp;</span><span
style="color: #ff0000">%</span><span
style="color: #0000ff">&gt;&#8217;&nbsp;/&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;/</span><span
style="color: #800000">ItemTemplate</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">HeaderTemplate</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #ff0000">&amp;nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">input&nbsp;</span><span
style="color: #ff0000">id</span><span
style="color: #0000ff">=&#8221;CheckAll&#8221;</span><span
style="color: #ff0000">&nbsp;type</span><span
style="color: #0000ff">=&#8221;checkbox&#8221;</span><span
style="color: #ff0000">&nbsp;onclick</span><span
style="color: #0000ff">=&#8221;selectAll(this);&#8221;</span><span
style="color: #ff0000">&nbsp;</span><span
style="color: #0000ff">/&gt;</span><span
style="color: #000000">全选&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;/</span><span
style="color: #800000">HeaderTemplate</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br
/> </span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">asp:BoundField&nbsp;</span><span
style="color: #ff0000">DataField</span><span
style="color: #0000ff">=&#8221;id&#8221;</span><span
style="color: #ff0000">&nbsp;HeaderText</span><span
style="color: #0000ff">=&#8221;id&#8221;</span><span
style="color: #ff0000">&nbsp;InsertVisible</span><span
style="color: #0000ff">=&#8221;False&#8221;</span><span
style="color: #ff0000">&nbsp;ReadOnly</span><span
style="color: #0000ff">=&#8221;True&#8221;</span><span
style="color: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p><span
style="color: #ff0000">&nbsp;SortExpression</span><span
style="color: #0000ff">=&#8221;id&#8221;</span><span
style="color: #ff0000">&nbsp;</span><span
style="color: #0000ff">/&gt;</span><span
style="color: #000000"><br
/> &nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">asp:BoundField&nbsp;</span><span
style="color: #ff0000">DataField</span><span
style="color: #0000ff">=&#8221;name&#8221;</span><span
style="color: #ff0000">&nbsp;HeaderText</span><span
style="color: #0000ff">=&#8221;name&#8221;</span><span
style="color: #ff0000">&nbsp;SortExpression</span><span
style="color: #0000ff">=&#8221;name&#8221;</span><span
style="color: #ff0000">&nbsp;</span><span
style="color: #0000ff">/&gt;</span><span
style="color: #000000">&nbsp;<br
/> &nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">asp:BoundField&nbsp;</span><span
style="color: #ff0000">DataField</span><span
style="color: #0000ff">=&#8221;sex&#8221;</span><span
style="color: #ff0000">&nbsp;HeaderText</span><span
style="color: #0000ff">=&#8221;sex&#8221;</span><span
style="color: #ff0000">&nbsp;SortExpression</span><span
style="color: #0000ff">=&#8221;sex&#8221;</span><span
style="color: #ff0000">&nbsp;</span><span
style="color: #0000ff">/&gt;</span><span
style="color: #000000">&nbsp;<br
/> &nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;</span><span
style="color: #800000">asp:BoundField&nbsp;</span><span
style="color: #ff0000">DataField</span><span
style="color: #0000ff">=&#8221;deptid&#8221;</span><span
style="color: #ff0000">&nbsp;HeaderText</span><span
style="color: #0000ff">=&#8221;deptid&#8221;</span><span
style="color: #ff0000">&nbsp;SortExpression</span><span
style="color: #0000ff">=&#8221;deptid&#8221;</span><span
style="color: #ff0000">&nbsp;</span><span
style="color: #0000ff">/&gt;</span><span
style="color: #000000">&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;/</span><span
style="color: #800000">Columns</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000">&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">&lt;/</span><span
style="color: #800000">asp:GridView</span><span
style="color: #0000ff">&gt;</span><span
style="color: #000000">&nbsp;&nbsp;</span></div><p>js代码中的selectAll(obj)方法在IE中可以正常使用。昨天，一朋友做测试，发现在FireFox中不支持，让我帮着找找原因，估计是js的代码有不兼容Firefox的，查有关资料，原来在firefox不支持parentElement，但支持parentNode，于是把原来的js代码修改了一下，通过obj.parentNode.parentNode.parentNode 来获取表格对象（GridView编译后形成的表格），不过要找到CheckBox对象要麻烦点，因为没法通过obj.parentElement.cellIndex 来定位找到ChecKbox所在位置了，只能通过循环某一行的单元格来查找了。具体的代码如下：</p><div
class="code"><span
style="color: #000000"><br
/> </span><span
style="color: #0000ff">function</span><span
style="color: #000000">&nbsp;select_all(obj)&nbsp;&nbsp;&nbsp;<br
/> {&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">var</span><span
style="color: #000000">&nbsp;theTable&nbsp;&nbsp;</span><span
style="color: #000000">=</span><span
style="color: #000000">&nbsp;obj.parentNode.parentNode.parentNode;&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">var</span><span
style="color: #000000">&nbsp;j&nbsp;</span><span
style="color: #000000">=</span><span
style="color: #000000">&nbsp;obj.parentNode.cellIndex;&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">for</span><span
style="color: #000000">(</span><span
style="color: #0000ff">var</span><span
style="color: #000000">&nbsp;i</span><span
style="color: #000000">=</span><span
style="color: #000000">0</span><span
style="color: #000000">;&nbsp;i</span><span
style="color: #000000">&lt;</span><span
style="color: #000000">theTable.rows.length;&nbsp;i</span><span
style="color: #000000">++</span><span
style="color: #000000">)&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">var</span><span
style="color: #000000">&nbsp;objCheckBox&nbsp;</span><span
style="color: #000000">=</span><span
style="color: #000000">&nbsp;GetCheckBoxObj(theTable.rows[i].cells[j]);&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">if</span><span
style="color: #000000">(objCheckBox.checked&nbsp;</span><span
style="color: #000000">!=</span><span
style="color: #000000">&nbsp;</span><span
style="color: #0000ff">null</span><span
style="color: #000000">)&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objCheckBox.checked&nbsp;</span><span
style="color: #000000">=</span><span
style="color: #000000">&nbsp;obj.checked;&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br
/> }&nbsp;&nbsp;</p><p></span><span
style="color: #0000ff">function</span><span
style="color: #000000">&nbsp;GetCheckBoxObj(objCell)&nbsp;&nbsp;&nbsp;<br
/> {&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">for</span><span
style="color: #000000">(</span><span
style="color: #0000ff">var</span><span
style="color: #000000">&nbsp;i</span><span
style="color: #000000">=</span><span
style="color: #000000">&nbsp;</span><span
style="color: #000000">0</span><span
style="color: #000000">;&nbsp;i&nbsp;</span><span
style="color: #000000">&lt;</span><span
style="color: #000000">&nbsp;objCell.childNodes.length;&nbsp;i</span><span
style="color: #000000">++</span><span
style="color: #000000">)&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">if</span><span
style="color: #000000">(objCell.childNodes[i].id)&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
style="color: #0000ff">return</span><span
style="color: #000000">&nbsp;objCell.childNodes[i];&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br
/> }&nbsp;&nbsp;&nbsp;<br
/> &nbsp;&nbsp;</span></div><p>如此修改后，这个<a
href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html">checkbox就可以兼容IE和FireFox</a>了。 </p><p>看来要是在web开发来要想兼容IE和Firefox，这个工作还是蛮艰巨的。有关firefox与ie 的javascript区别 的你看看<a
href="http://www.cnblogs.com/JustinYoung/articles/javascript-on-FireFox-and-IE.html" target="_blank">这里</a>，总结非常详细。不但是js，css也有很多不一样的地方。嘿嘿，由此我有点怀念IE一统天下的年代了,不过我觉得一般企业级的应用还是不专门考虑FireFox了，除非做门户网站。<br
/> 本文地址：<a
href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html">http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html</a></p><p
class="akst_link"></p><h4>你可能也会喜欢以下文章：</h4><ul
class="st-related-posts"><li><a
href="http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html" title="web developer tips (53):在vs的设计视图编辑gridview的模板 (2009-10-12)">web developer tips (53):在vs的设计视图编辑gridview的模板</a> (0)</li><li><a
href="http://www.watch-life.net/programming-notes/2-domainname-realization.html" title="关于二级域名(泛二级域名)的实现 (2007-06-28)">关于二级域名(泛二级域名)的实现</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/the-style-application-toolbar-works-in-both-auto-and-manual-modes.html" title="web developer tips (2):样式应用工具栏的工作模式 (2009-05-24)">web developer tips (2):样式应用工具栏的工作模式</a> (0)</li><li><a
href="http://www.watch-life.net/javascript/help-i-dont-know-javascript.html" title="帮帮我！我不懂JavaScript (2009-09-30)">帮帮我！我不懂JavaScript</a> (3)</li><li><a
href="http://www.watch-life.net/visual-studio/visual-web-developer-2008-has-a-new-style-builder-dialog.html" title="web developer tips (10):Visual Web Developer 2008中新的样式生成器 (2009-06-23)">web developer tips (10):Visual Web Developer 2008中新的样式生成器</a> (0)</li><li><a
href="http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html" title="web developer tips (5):绑定ListView控件 (2009-06-12)">web developer tips (5):绑定ListView控件</a> (1)</li><li><a
href="http://www.watch-life.net/visual-studio/create-an-iis-virtual-directory-from-within-visual-web-developer.html" title="web developer tips (12):在Visual Web Developer里创建IIS虚拟目录 (2009-06-26)">web developer tips (12):在Visual Web Developer里创建IIS虚拟目录</a> (0)</li><li><a
href="http://www.watch-life.net/vs2005/vss2005-internet-suport.html" title="设置VSS2005使支持通过Internet访问（转） (2007-07-09)">设置VSS2005使支持通过Internet访问（转）</a> (0)</li></ul>转载请注明作者，出处，以及原始超链接。<br
/>评论数：0 | <b><a
href='http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a
href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a
href='http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html'>www.watch-life.net</a>]]></content:encoded> <wfw:commentRss>http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: www.watch-life.net @ 2010-09-09 11:04:26 by W3 Total Cache -->