<?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>睡到25点 &#187; html</title>
	<atom:link href="http://www.voidman.com/tag/html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.voidman.com</link>
	<description>个人博客，记录与分享。</description>
	<lastBuildDate>Thu, 12 Jan 2012 14:00:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HTML button 标签的默认 Type 属性</title>
		<link>http://www.voidman.com/2008/02/html-button-tag-default-type-attribute.html</link>
		<comments>http://www.voidman.com/2008/02/html-button-tag-default-type-attribute.html#comments</comments>
		<pubDate>Thu, 21 Feb 2008 04:45:42 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[k2]]></category>

		<guid isPermaLink="false">http://www.voidman.com/2008/02/html-button-tag-default-type-attribute/</guid>
		<description><![CDATA[在装上 K2 RC4 主题后，发现如果用 IE 访问 WP 后台无法保存 K2 的设置选项，点击 Save 按钮后毫无反应，Firefox、Opera、Safari则正常。看了看源代码，K2 是这样定义这个按钮的： &#60;button&#62;&#60; ?php echo attribute_escape&#40;__&#40;'Save','k2_domain'&#41;&#41;;?&#62;&#60;/button&#62; 之前很少使用过 &#60;button&#62; 标签，所以开始还以为 K2 绑定了按钮事件不支持 IE，不过浏览了一通代码也没找到，才意识到问题可能出在标签的未指定 type 属性上了，于是加上 type="submit"，问题解决。 又特意找了找相关资料，W3C 对 button 标签的 type 属性定义是： submit: Creates a submit button. This is the &#8230; <a href="http://www.voidman.com/2008/02/html-button-tag-default-type-attribute.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>在装上 <a href="http://getk2.com/download"  rel="external nofollow">K2 RC4</a> 主题后，发现如果用 IE 访问 WP 后台无法保存 K2 的设置选项，点击 Save 按钮后毫无反应，Firefox、Opera、Safari则正常。看了看源代码，K2 是这样定义这个按钮的：</p>

<div class="wp_syntax"><pre class="html4strict"><span style="color: #800000"><span style="color: blue;">&lt;button&gt;</span></span><span style="color: #800000">&lt; ?php echo attribute_escape<span style="color: #800000">&#40;</span>__<span style="color: #800000">&#40;</span><span style="color: #ff00ff;">'Save'</span>,<span style="color: #ff00ff;">'k2_domain'</span><span style="color: #800000">&#41;</span><span style="color: #800000">&#41;</span>;?&gt;</span><span style="color: #800000"><span style="color: blue;">&lt;/button&gt;</span></span></pre></div>

<p>之前很少使用过 &lt;button&gt; 标签，所以开始还以为 K2 绑定了按钮事件不支持 IE，不过浏览了一通代码也没找到，才意识到问题可能出在标签的未指定 type 属性上了，于是加上 type="submit"，问题解决。</p>
<p>又特意找了找相关资料，<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-type-BUTTON" title="adef-type-BUTTON-W3C"  rel="external nofollow">W3C</a> 对 button 标签的 type 属性定义是：</p>
<blockquote class="quote"><p>submit: Creates a submit button. <strong>This is the default value</strong>.<br />
 reset: Creates a reset button.<br />
button: Creates a push button.</p></blockquote>
<p>而 <a href="http://msdn2.microsoft.com/en-us/library/ms534696(VS.85).aspx"  rel="external nofollow" title="type Property (BUTTON) - MSDN">MSDN</a> 中则如此解释：</p>
<blockquote class="quote"><p>button: <strong>Default</strong>. Creates a Command button.<br />
 reset: Creates a Reset button. If the button is in a form,<br />
        it resets the fields in the form to their initial values.<br />
submit: Creates a Submit button. If the button is in a form,<br />
        it submits the form.</p></blockquote>
<p>原来如此。fuck IE!</p>
<hr /><a href="http://www.voidman.com">Voidman.com</a> | Link: <a href="http://www.voidman.com/2008/02/html-button-tag-default-type-attribute.html">http://www.voidman.com/2008/02/html-button-tag-default-type-attribute.html</a><br /><img alt="linezing" width="1" height="1" src="http://img.tongji.linezing.com/288120/tongji.gif" />]]></content:encoded>
			<wfw:commentRss>http://www.voidman.com/2008/02/html-button-tag-default-type-attribute.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

