<?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.cqnv.com/tags/ie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cqnv.com</link>
	<description>谈谈情,说说爱,非游山玩水博客...</description>
	<lastBuildDate>Sat, 24 Jul 2010 13:22:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>IE6是网络毒瘤,是人类进步的绊脚石</title>
		<link>http://www.cqnv.com/post/ie6-is-network-cancer/</link>
		<comments>http://www.cqnv.com/post/ie6-is-network-cancer/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 12:30:58 +0000</pubDate>
		<dc:creator>wanwan</dc:creator>
				<category><![CDATA[回收┊坚持及放弃]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[改版]]></category>

		<guid isPermaLink="false">http://www.cqnv.com/?p=1625</guid>
		<description><![CDATA[昨天晚上好不容易把国庆的皮肤做好了.用IE8,FF,Chrome浏览,完全正确,样子也还多好看.今天早上叫Bruce童鞋帮我看哈CSS表加载正确否.结果,结果,Bruce童鞋发来这张图片,确实让我囧了把:

确实很囧人,作为一名CSS学习者,弄出这种垃圾版面来,也不能饶恕啊....我问Bruce童鞋,你用的啥浏览器啊,我这儿什么都是正常的啊,答曰:ie6.这哈就焖了...其实平时我倒没有想有些人一样,写个判断语句,如果是IE6或者以下版本,直接关闭页面,给出提示:

对不起,本站不支持IE7以下版本访问本站,请升级IE版本后再来,或者移步他站...

呵呵,我研究了半天,我说我的CSS都很简单啊.不会出错啊...后来观察了一下,怀疑是我的迷你导航栏出错了..IE6估计不支持我的CSS写法.没办法了.我得想办法.办法终究是人想的,于是,方法出炉了.其实想法就是,写个代码,如果是IE7以下版本,直接牺牲掉迷你导航栏,不让它显示即可.]]></description>
			<content:encoded><![CDATA[<p><a class="highslide-image" onclick="return hs.expand(this, {captionId:'caption_1252037914078'});" href="http://www.cqnv.com/wp-content/uploads//2009/09/fuck-ie-6.jpg"><img class=" alignright" title="点击放大 IE6是网络毒瘤,是人类进步的绊脚石" src="http://www.cqnv.com/wp-content/uploads//2009/09/fuck-ie-6-300x168.jpg" alt="IE6是网络毒瘤,是人类进步的绊脚石" /></a></p>
<div id="caption_1252037914078" class="highslide-caption">IE6是网络毒瘤,是人类进步的绊脚石</div>
<p>昨天晚上好不容易把国庆的皮肤做好了.用IE8,FF,Chrome浏览,完全正确,样子也还多好看.今天早上叫Bruce童鞋帮我看哈CSS表加载正确否.结果,结果,Bruce童鞋发来这张图片,确实让我囧了把:</p>
<p>确实很囧人,作为一名CSS学习者,弄出这种垃圾版面来,也不能饶恕啊&#8230;.我问Bruce童鞋,你用的啥浏览器啊,我这儿什么都是正常的啊,答曰:ie6.这哈就焖了&#8230;其实平时我倒没有想有些人一样,写个判断语句,如果是IE6或者以下版本,直接关闭页面,给出提示:</p>
<p>对不起,本站不支持IE7以下版本访问本站,请升级IE版本后再来,或者移步他站&#8230;</p>
<p>呵呵,我研究了半天,我说我的CSS都很简单啊.不会出错啊&#8230;后来观察了一下,怀疑是我的迷你导航栏出错了..IE6估计不支持我的CSS写法.没办法了.我得想办法.办法终究是人想的,于是,方法出炉了.其实想法就是,写个代码,如果是IE7以下版本,直接牺牲掉迷你导航栏,不让它显示即可.</p>
<p>在百度上搜了很多,只有一些关于在IE浏览器里辨别IE版本的代码,也就是说,我们可以用如下代码:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> <span style="color: #339933;">!</span>IE<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>除IE外都可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> IE<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> 所有的IE可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> IE <span style="color:#800080;">5.0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> 只有IE5<span style="color: #339933;">.</span>0可以识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> IE <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> 仅IE5<span style="color: #339933;">.</span>0与IE5<span style="color: #339933;">.</span>5可以识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> gt IE <span style="color:#800080;">5.0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> IE5<span style="color: #339933;">.</span>0以及IE5<span style="color: #339933;">.</span>0以上版本都可以识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> IE <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> 仅IE6可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> lt IE <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> IE6以及IE6以下版本可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> gte IE <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> IE6以及IE6以上版本可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> IE <span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> 仅IE7可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> lt IE <span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> IE7以及IE7以下版本可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;!--</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">if</span> gte IE <span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> IE7以及IE7以上版本可识别 <span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span><span style="color: #b1b100;">endif</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--&gt;</span></pre></div></div>

<p>其实上面的第一条感觉是错的.因为我的想法就是,如果是IE7或者更高版本,就显示迷你导航栏;如果是非IE浏览器,也显示迷你导航栏.结果IE6上终于显示正常了.但是FF,CHROME上也没有迷你导航栏了..也就是说第一条压根就不能实现&#8230;</p>
<p>又去百度,狗狗,发现很多人都说.判断IE版本挺容易,但是要判断不是IE就非常恼火,倒是有一个人有想法,用JS解释不同之处来判断,答案就是</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\v</span>&quot;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;v&quot;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p> //而且对IE8.0也有效.如下:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;script language</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\v</span>&quot;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;v&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;这是IE浏览器&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;这不是IE浏览器&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></pre></div></div>

<p>但是我不是很喜欢.我觉得吧,还是不用JS这玩意来判断好.我突然想到了用PHP来判断:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!--以下代码判断,若是IE,则--&gt; 
<span style="color: #000000; font-weight: bold;">&lt;?PHP</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strspn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MSIE&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_USER_AGENT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
再采用 判断IE6的方法,即:
&lt;!-- 以下代码判断:若IE版本高于6,显示代码 --&gt;
&lt;!--[if gte IE 7]&gt;</pre></div></div>

<p>最后用一个ELSE语句,不是IE的,全部都显示迷你导航栏.</p>
<p>测试后,搞定&#8230;丫的为了能兼容IE6,真是让我花了不少心思&#8230;.</p>
<p>IE6是网络毒瘤,是人类进步的绊脚石,我说的一点都不为过&#8230;呵呵&#8230;</p>
<h3  class="related_post_title">相关文章:</h3><ul class="related_post"><li>2009年08月11日 -- <a href="http://www.cqnv.com/post/head-characters-automation-empty-space/" title="WP如何实现段首文字自动空两格？">WP如何实现段首文字自动空两格？</a> (6)<br /><small>你是否经常的在每辛辛苦苦编完一篇原创日志,结果大汗淋漓的提交后,发现无法一眼就分...</small></li><li>2009年11月8日 -- <a href="http://www.cqnv.com/post/how_can_i_get_qqfarm_ca/" title="QQ农场计算器网页版(附下载)">QQ农场计算器网页版(附下载)</a> (0)<br /><small>我一直在用的其实不是这个，是需要下载到电脑里面去的时间计算器(非外挂)。不过作者...</small></li><li>2009年09月3日 -- <a href="http://www.cqnv.com/post/if-jiong-please-jiong-deeply/" title="如果囧,请深囧&#8230;">如果囧,请深囧&#8230;</a> (5)<br /><small>好久没写东西了,脚踩西瓜皮溜一下吧~ 其实,现在并非颓废的年代.但是事实上,我却...</small></li><li>2009年08月4日 -- <a href="http://www.cqnv.com/post/drop-wp-title/" title="如何去掉WP title中文章标题前的»">如何去掉WP title中文章标题前的»</a> (3)<br /><small>  请不要总是认为自己记性相当好，一些不大不小的东西一定会记得。前两天做这个WP...</small></li><li>2009年08月1日 -- <a href="http://www.cqnv.com/post/pirate-genius/" title="我觉得我就是盗版天才。。。">我觉得我就是盗版天才。。。</a> (0)<br /><small>发现我的网站有什么特点没。嘿嘿

如何设置首页不显示某些分类的文章？

...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.cqnv.com/post/ie6-is-network-cancer/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
