<?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://bluehua.org/tag/ie/feed" rel="self" type="application/rss+xml" />
	<link>http://bluehua.org</link>
	<description>分享所学,backup一切~</description>
	<lastBuildDate>Fri, 13 Apr 2012 14:08:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>comet的两个小问题</title>
		<link>http://bluehua.org/2011/05/31/1628.html</link>
		<comments>http://bluehua.org/2011/05/31/1628.html#comments</comments>
		<pubDate>Tue, 31 May 2011 01:06:04 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[comet]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[longpoll]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1628</guid>
		<description><![CDATA[最近做了一个webim的项目，使用长连接做push，在chrome和ie下有些小问题 1. chrome的左下角下一直显示等待push.xx.com的响应 解决方法：接到请求立刻返回http头就可以了，不等到有了推送再返回http头 2.ie下对于每个域名同一时刻最多只能有两个并发请求，如果开多个窗口（这个限制不是针对单个窗口的），有的请求便会被阻塞。 解决方法：对每个窗口使用不同的请求域名 使用三级泛域名配置起来最简单，例如：123.push.xx.com.但是JS里涉及到跨域的问题，所以还是要使用push-123.xx.com这样的二级域名。查了下bind9的手册可以这么搞 ;示例 $GENERATE 0-100000 push-$ IN A xx.xx.xx.xx 这样ie下JS可以用时间戳或随机数决定一个domain去请求，不会产生阻塞]]></description>
			<content:encoded><![CDATA[<p>最近做了一个webim的项目，使用长连接做push，在chrome和ie下有些小问题</p>
<p>1. chrome的左下角下一直显示等待push.xx.com的响应</p>
<p>解决方法：接到请求立刻返回http头就可以了，不等到有了推送再返回http头</p>
<p>2.ie下对于每个域名同一时刻最多只能有两个并发请求，如果开多个窗口（这个限制不是针对单个窗口的），有的请求便会被阻塞。</p>
<p>解决方法：对每个窗口使用不同的请求域名<br />
使用三级泛域名配置起来最简单，例如：123.push.xx.com.但是JS里涉及到跨域的问题，所以还是要使用push-123.xx.com这样的二级域名。查了下bind9的手册可以这么搞</p>

<div class="wp_syntax"><div class="code overflow"><pre class="text" style="font-family:monospace;">;示例
$GENERATE 0-100000 push-$ IN A xx.xx.xx.xx</pre></div></div>

<p>这样ie下JS可以用时间戳或随机数决定一个domain去请求，不会产生阻塞</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2011/05/31/1628.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ie-css3.htc的修正增强版</title>
		<link>http://bluehua.org/2010/07/04/1327.html</link>
		<comments>http://bluehua.org/2010/07/04/1327.html#comments</comments>
		<pubDate>Sun, 04 Jul 2010 01:36:42 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[behavior]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[radius]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1327</guid>
		<description><![CDATA[做前端的同学都应该听说或者用过，是一段脚本，可以让ie实现css3里的圆角和阴影效果：http://fetchak.com/ie-css3/ 用法大致如下 .box &#123; -moz-border-radius: 15px; /* Firefox */ -webkit-border-radius: 15px; /* Safari and Chrome */ border-radius: 15px; /* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */ &#160; -moz-box-shadow: 10px 10px 20px #000; /* Firefox */ -webkit-box-shadow: 10px 10px 20px #000; /* Safari and Chrome */ box-shadow: 10px 10px 20px [...]]]></description>
			<content:encoded><![CDATA[<p>做前端的同学都应该听说或者用过，是一段脚本，可以让ie实现css3里的圆角和阴影效果：<a href="http://fetchak.com/ie-css3/">http://fetchak.com/ie-css3/</a></p>
<p>用法大致如下</p>

<div class="wp_syntax"><div class="code overflow"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span>
  -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Firefox */</span>
  -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Safari and Chrome */</span>
  border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */</span>
&nbsp;
  -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">20px</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Firefox */</span>
  -webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">20px</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Safari and Chrome */</span>
  box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">20px</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Opera 10.5+, future browsers and IE6+ using IE-CSS3 */</span>
&nbsp;
  behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>ie-css3.htc<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* This lets IE know to call the script on all elements which get the 'box' class */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>最近用到了这个东西，发现动态改变div的内容之后，这段脚本生成的vml会出现变形。。<br />
所以加了一个手动刷新的函数，通过innerHTML赋值之后调用一下就可以了</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;">el.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'....'</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">update_css3_fix</span><span style="color: #009900;">&#41;</span> update_css3_fix<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>如果使用jquery就不用这么麻烦，在你的框架里加一段</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>jQuery.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
    jQuery.<span style="color: #660066;">fn</span>.__ohtml__ <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">html</span><span style="color: #339933;">;</span>
    jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">html</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.__ohtml__<span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            update_css3_fix<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>另外官网下载的脚本还会产生yourdomain/none的404请求，也已经修复</p>
<p>修改之后的文件<a href='http://bluehua.org/wp-content/uploads/2010/07/ie-css3.htc.zip'>ie-css3.htc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/07/04/1327.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ie下暴力debug js</title>
		<link>http://bluehua.org/2010/02/25/976.html</link>
		<comments>http://bluehua.org/2010/02/25/976.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 09:03:43 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=976</guid>
		<description><![CDATA[ie下的脚本错误总是很神秘的样子,告诉你哪个行,确不告诉你哪个文件,Visual Studio带了一个调试工具倒是可以,long long ago之前用过一次,老崩溃的样子~ 如果你又遇到了猜不透的bug,可以尝试下面的shell~ //现去firefox里收集一份js列表 var alljs = &#91;&#93;; XN.array.each&#40;document.getElementsByTagName&#40;'script'&#41;,function&#40;i,v&#41; &#123; if &#40;v.src&#41; &#123; alljs.push&#40;v.src&#41;; &#125; &#125;&#41;; console.log&#40;alljs.join&#40;'\n'&#41;&#41;; 把列表保存到一个文件,下面跑段shell,把所有js的报错位置的代码打印出来 // 10 100是ie里提示的错误位置 sh ~/bin/get_line.sh /tmp/jslist 10 100 附: #!/bin/sh LIST=&#34;$1&#34; ROW=&#34;$2&#34; COL=&#34;$3&#34; &#160; if &#91; ! -n &#34;$ROW&#34; &#93;;then exit fi &#160; echo &#34;行:${ROW}&#34; echo &#34;列:${COL}&#34; &#160; get_row&#40;&#41; &#123; cat /tmp/js_debug_tmp &#124; sed -n [...]]]></description>
			<content:encoded><![CDATA[<p>ie下的脚本错误总是很神秘的样子,告诉你哪个行,确不告诉你哪个文件,Visual Studio带了一个调试工具倒是可以,long long ago之前用过一次,老崩溃的样子~<br />
如果你又遇到了猜不透的bug,可以尝试下面的shell~</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//现去firefox里收集一份js列表</span>
<span style="color: #003366; font-weight: bold;">var</span> alljs <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
XN.<span style="color: #660066;">array</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span>v<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>v.<span style="color: #660066;">src</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        alljs.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>v.<span style="color: #660066;">src</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>alljs.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>把列表保存到一个文件,下面跑段shell,把所有js的报错位置的代码打印出来</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">//</span> <span style="color: #000000;">10</span> <span style="color: #000000;">100</span>是ie里提示的错误位置
<span style="color: #c20cb9; font-weight: bold;">sh</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>get_line.sh <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>jslist <span style="color: #000000;">10</span> <span style="color: #000000;">100</span></pre></div></div>

<p>附:</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #007800;">ROW</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
<span style="color: #007800;">COL</span>=<span style="color: #ff0000;">&quot;$3&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ROW</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;行:<span style="color: #007800;">${ROW}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;列:<span style="color: #007800;">${COL}</span>&quot;</span>
&nbsp;
get_row<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>js_debug_tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${ROW}</span>p&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$LIST</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> line
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$line</span>&quot;</span> <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>js_debug_tmp 
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;文件:<span style="color: #007800;">${line}</span>&quot;</span>
    <span style="color: #007800;">row</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`get_row`</span>&quot;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${COL}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">row</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo \&quot;${row}\&quot; | cut -c ${COL}- `</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$row</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>js_debug_tmp</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/02/25/976.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>getAttribute(&#8216;onclick&#8217;) in IE</title>
		<link>http://bluehua.org/2009/09/11/550.html</link>
		<comments>http://bluehua.org/2009/09/11/550.html#comments</comments>
		<pubDate>Fri, 11 Sep 2009 09:05:31 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=550</guid>
		<description><![CDATA[第n次火星了,可是依然没去过火星. 这个是最近用到才知道,需求是替换onclick属性中的关键字,但是俺单纯的以为geAttribute都会返回一个字符串给我,没想到ie又一次显示了它独到的见解~ &#60;html&#62; &#60;p id=&#34;test&#34; onclick=&#34;alert('click');&#34;&#62;click me~&#60;/p&#62; &#60;script&#62; document.write&#40;'&#60;pre' + '&#62;'&#41;; var el = document.getElementById&#40;'test'&#41;; var at = el.getAttribute&#40;'onclick'&#41;; document.writeln&#40;at&#41;; document.writeln&#40;typeof at&#41;; document.write&#40;'&#60;/' + 'pre&#62;'&#41;; &#60;/script&#62; &#60;/html&#62; ff下输出 alert('click'); string ie6和ie7下输出: function anonymous() { alert('click'); } function ie8下输出: function onclick() { alert('click'); } function 其他事件属性肯定也会有同样表现,ie8十分搞笑,换了一个函数名&#8230; 最后对于ie我只有这样了: &#60;html&#62; &#60;p id=&#34;test&#34; onclick=&#34;alert('click');&#34;&#62;click me~&#60;/p&#62; &#60;script&#62; var el = [...]]]></description>
			<content:encoded><![CDATA[<p>第n次火星了,可是依然没去过火星.<br />
这个是最近用到才知道,需求是替换onclick属性中的关键字,但是俺单纯的以为geAttribute都会返回一个字符串给我,没想到ie又一次显示了它独到的见解~</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;test&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;alert('click');&quot;</span><span style="color: #339933;">&gt;</span>click me~<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;pre'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> el <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> at <span style="color: #339933;">=</span> el.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'onclick'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">writeln</span><span style="color: #009900;">&#40;</span>at<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">writeln</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> at<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;/'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'pre&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

<p>ff下输出</p>
<pre>
alert('click');
string
</pre>
<p>ie6和ie7下输出:</p>
<pre>
function anonymous()
{
alert('click');
}
function
</pre>
<p>ie8下输出:</p>
<pre>
function onclick()
{
alert('click');
}
function
</pre>
<p>其他事件属性肯定也会有同样表现,ie8十分搞笑,换了一个函数名&#8230;</p>
<p>最后对于ie我只有这样了:</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;test&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;alert('click');&quot;</span><span style="color: #339933;">&gt;</span>click me~<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> el <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> at <span style="color: #339933;">=</span> el.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'onclick'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//函数换成字符串</span>
at <span style="color: #339933;">=</span> at.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^function (anonymous|onclick)\(\)\n\{\n(.*)\n\}$/m</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'$2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//替换关键词</span>
at <span style="color: #339933;">=</span> at.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'wahaha'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//再变成函数放回去</span>
el.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'onclick'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Function</span><span style="color: #009900;">&#40;</span>at<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/09/11/550.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ie下的默认回车提交之强大&#8230;</title>
		<link>http://bluehua.org/2009/06/16/321.html</link>
		<comments>http://bluehua.org/2009/06/16/321.html#comments</comments>
		<pubDate>Tue, 16 Jun 2009 10:08:56 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=321</guid>
		<description><![CDATA[ie下如果您在text输入框按回车就会默认将表单提交，可是俺万万没有想到，竟然强大到连submit的onclick事件都能触发了&#8230; 示例1：input外面有form标签,输入框按回车会提交表单 &#60;html&#62; &#60;body&#62; &#60;form action=&#34;http://g.cn&#34;&#62; &#60;input type=&#34;submit&#34; value=&#34;haha&#34; onclick=&#34;alert(1);&#34; /&#62; &#60;input type=&#34;text&#34; /&#62; &#60;/form&#62; &#60;/body&#62; &#60;/html&#62; 示例2：input外面没有form标签，输入框按回车会触发submit的onclick事件 &#60;html&#62; &#60;body&#62; &#60;input type=&#34;submit&#34; value=&#34;haha&#34; onclick=&#34;alert(1);&#34; /&#62; &#60;input type=&#34;text&#34; /&#62; &#60;/body&#62; &#60;/html&#62; ajax提交流行的今天，form标签往往直接被省略，所以这个特性很可能造成用户在某个输入框按了回车，然后某处一个不相关的button被ie点了一下&#8230;.]]></description>
			<content:encoded><![CDATA[<p>ie下如果您在text输入框按回车就会默认将表单提交，可是俺万万没有想到，竟然强大到连submit的onclick事件都能触发了&#8230;</p>
<p>示例1：input外面有form标签,输入框按回车会提交表单</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://g.cn&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;haha&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;alert(1);&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;</span>input  type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

<p>示例2：input外面没有form标签，输入框按回车会触发submit的onclick事件</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;haha&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;alert(1);&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input  type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

<p>ajax提交流行的今天，form标签往往直接被省略，所以这个特性很可能造成用户在某个输入框按了回车，然后某处一个不相关的button被ie点了一下&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/06/16/321.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ie下title里出现重复锚点的bug</title>
		<link>http://bluehua.org/2009/05/21/300.html</link>
		<comments>http://bluehua.org/2009/05/21/300.html#comments</comments>
		<pubDate>Thu, 21 May 2009 13:55:45 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=300</guid>
		<description><![CDATA[以前人品好，没碰到过&#8230; 情况就是当页面里有n(n&#62;0)个flash，而且url里带有锚点时页面的title后面就会跟n个锚点 应该算adobe flash 的bug吧，具体： http://bugs.adobe.com/jira/browse/FP-240 IE appends anchor name to title bar adobe的网站上说Flash Player 9 &#8211; 9_0_124_0,IE7下才有这个问题，可俺的问题是在flash10，ie6下发现的，不靠谱&#8230;&#8230;]]></description>
			<content:encoded><![CDATA[<p>以前人品好，没碰到过&#8230;</p>
<p>情况就是当页面里有n(n&gt;0)个flash，而且url里带有锚点时页面的title后面就会跟n个锚点</p>
<p><img class="pie-img" src="http://lh4.ggpht.com/_l8FcMjS-xnI/ShVZYJWmekI/AAAAAAAAE54/hOghQxDwDos/screenshot_014.png?imgmax=640" alt="screenshot_014.png" /></p>
<p>应该算adobe flash 的bug吧，具体：</p>
<p><a href="http://bugs.adobe.com/jira/browse/FP-240">http://bugs.adobe.com/jira/browse/FP-240</a></p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/c91e3dc4-ef05-47f9-b799-db149e3ddc80">IE appends anchor name to title bar</a></p>
<p>adobe的网站上说Flash Player 9              &#8211; 9_0_124_0,IE7下才有这个问题，可俺的问题是在flash10，ie6下发现的，不靠谱&#8230;&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/05/21/300.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.454 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-22 08:46:24 -->

