<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[如何给按钮加上链接功能]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 04 Sep 2007 12:10:45 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	如何给按钮加上链接功能 <br/>解决思路： <br/>按钮属于控件级的对象，优先级比较高，所以不能象图片或文本一样直接加链接，只能通过按钮的单击事件调用脚本的方式来实现。 <br/>具体步骤： <br/> &nbsp; &nbsp;1.在原窗口打开链接 <br/><br/> &nbsp; &nbsp;&lt;input type=&quot;button&quot; &nbsp;<br/>value=&quot;闪吧&quot; onClick=&quot;location=’http://www.flash8.net’&quot;&gt; <br/> &nbsp; &nbsp;&lt;button onClick=&quot;location.href=’http://www.flash8.net’&quot;&gt;闪吧&lt;/button&gt; <br/> &nbsp; &nbsp;&lt;form action=&quot;http://www.flash8.net&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;打开链接&quot;&gt;&lt;/form&gt; <br/><br/> &nbsp; &nbsp;2.在新窗口中打开链接 <br/><br/> &nbsp; &nbsp;&lt;input type=&quot;button&quot; &nbsp;<br/>value=&quot;闪吧&quot; onClick=&quot;window.open(’http://www.flash8.net’)&quot;&gt; <br/> &nbsp; &nbsp;&lt;button onClick=&quot;window.open(’http://www.flash8.net’)&quot;&gt;闪吧&lt;/button&gt; <br/> &nbsp; &nbsp;&lt;form action=&quot;http://www.flash8.net&quot; &nbsp;<br/>target=&quot;_blank&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;打开链接&quot;&gt;&lt;/form&gt; <br/><br/>注意：onClick调用的代码里的引号在只有一重时可以单双嵌套，超过两重就必须用&quot;&#92;&quot;号转义且转义的引号必须跟里层的引号一致，如： <br/><br/>&lt;button onClick=&quot;this.innerHTML=’&lt;font color=&#92;’red&#92;’&gt;http://www.flash8.net&lt;/font&gt;’&quot;&gt;闪吧&lt;/button&gt; <br/><br/>或 <br/><br/>&lt;button onClick=’this.innerHTML=&quot;&lt;font color=&#92;&quot;red&#92;&quot;&gt;http://www.flash8.net&lt;/font&gt;&quot;’&gt;闪吧&lt;/button&gt; <br/><br/>而下面都是错误的写法： <br/><br/>&lt;button onClick=&quot;this.innerHTML=’&lt;font color=’red’&gt;http://www.flash8.net&lt;/font&gt;’&quot;&gt;闪吧&lt;/button&gt; <br/><br/>&lt;button onClick=&quot;this.innerHTML=’&lt;font color=&quot;red&quot;&gt;http://www.flash8.net&lt;/font&gt;’&quot;&gt;闪吧&lt;/button&gt; <br/><br/>&lt;button onClick=&quot;this.innerHTML=’&lt;font color=&#92;&quot;red&#92;&quot;&gt;http://www.flash8.net&lt;/font&gt;’&quot;&gt;闪吧&lt;/button&gt; <br/><br/> 提示：大部分属于window或document对象的方法和属性都可以省略前缀window或document，比如说本例中的location.href(location.href又可以简写为location，因为location的默认对象为href)就是window.location.href或document.location.href的省略式写法。 <br/>技巧：本例中还可以用下面的方法来代替location.href <br/>location.replace(url) <br/>location.assign(url) <br/>navigate(url) <br/>特别提示 <br/>第一步中的代码运行后，单击按钮将跳转到链接目标。而第二步的在单击按钮后将在新窗口中打开链接。 <br/><br/>特别说明<br/><br/>本例主要是通过用onClick捕获用户在按钮上的单击事件，然后调用location对象的href方法或window对象的open方法来打开链接。另外一个技巧是通过提交表单来实现链接功能，按钮必须是type=submit类型的按钮，表单的action值就是链接目标，target值就是链接打开的目标方式。
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 如何给按钮加上链接功能]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>