<?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; web</title>
	<atom:link href="http://daozhao.goflytoday.com/tag/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://daozhao.goflytoday.com</link>
	<description>大蕉，一种有益的水果。不过本blog并不是介绍大蕉。哈哈</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:56:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>jqtouch使用和bug</title>
		<link>http://daozhao.goflytoday.com/2010/01/jqtouch-use-and-bug/</link>
		<comments>http://daozhao.goflytoday.com/2010/01/jqtouch-use-and-bug/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 07:33:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[jqtouch]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://daozhao.goflytoday.com/?p=698</guid>
		<description><![CDATA[发现了一个非常好的jQuery插件jQTouch。这个插件是帮助你方便开发iphone上的浏览器上的web程序。使它的操作像原生的Iphone程序有良好的界面和操作交互。 我使用了他帮朋友搞左个应用，你可以使... ]]></description>
			<content:encoded><![CDATA[<p>发现了一个非常好的jQuery插件<a title="jqtouch" href="http://www.jqtouch.com/" target="_blank">jQTouch</a>。这个插件是帮助你方便开发iphone上的浏览器上的web程序。使它的操作像原生的Iphone程序有良好的界面和操作交互。</p>
<p>我使用了他帮朋友搞左个应用，你可以使用iphone或者ipod touch访问 <a href="http://www.goflytoday.com" target="_blank">http://www.goflytoday.com</a> 就可以访问到该应用了。如果你没有iphone的话，可以使用Apple Safari浏览器去访问<a href="http://www.goflytoday.com/airline2/iphone/iphone.htm" target="_blank">这个网址</a>体验一下效果，其效果基本和iphone差不多，只是有小许细节不一样(google android的手机都可以，我用hero试过，速度比较慢)。其他浏览器就不行。</p>
<p>我使用的是<a href="http://jqtouch.googlecode.com/files/jqtouch-1.0-beta-2-r109.zip">jqtouch-1.0-beta-2-r109.zip</a>这个版本。发现有一个bug。这个bug主要表现是当列表跳转的链接为空的时候，用户点击该链接的时候，连接会成另外一种状态后不会自动恢复原来的状态。<br />
<span id="more-698"></span><br />
这个bug位于函数 showPageByHref。原来函数写法如下：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> showPageByHref<span style="color: #009900;">&#40;</span>href<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> defaults <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
                data<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>
                method<span style="color: #339933;">:</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span>
                animation<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>
                callback<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>
                $referrer<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003366; font-weight: bold;">var</span> settings <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> defaults<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>href <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'#'</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                    url<span style="color: #339933;">:</span> href<span style="color: #339933;">,</span>
                    data<span style="color: #339933;">:</span> settings.<span style="color: #660066;">data</span><span style="color: #339933;">,</span>
                    type<span style="color: #339933;">:</span> settings.<span style="color: #660066;">method</span><span style="color: #339933;">,</span>
                    success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> textStatus<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #003366; font-weight: bold;">var</span> firstPage <span style="color: #339933;">=</span> insertPages<span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> settings.<span style="color: #660066;">animation</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>firstPage<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>settings.<span style="color: #660066;">method</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'GET'</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> jQTSettings.<span style="color: #660066;">cacheGetRequests</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> settings.$referrer<span style="color: #009900;">&#41;</span>
                            <span style="color: #009900;">&#123;</span>
                                settings.$referrer.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#'</span> <span style="color: #339933;">+</span> firstPage.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #009900;">&#125;</span>
                            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">callback</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                settings.<span style="color: #660066;">callback</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</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;">&#125;</span><span style="color: #339933;">,</span>
                    error<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>data<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>settings.$referrer<span style="color: #009900;">&#41;</span> settings.$referrer.<span style="color: #660066;">unselect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">callback</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            settings.<span style="color: #660066;">callback</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</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;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$referrer<span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                $referrer.<span style="color: #660066;">unselect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div>

<p>需要把把第463行修改成下边的写法就可以了。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">            <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>settings.$referrer<span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                settings.$referrer.<span style="color: #660066;">unselect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span></pre></div></div>

<p>这个bug已经向作者反映了。作者告诉我svn最新的版本已经把这个错误修改了。<br />
<h3>请看看相关文章</h3>
<ul class="related_post">
<li><a href="http://daozhao.goflytoday.com/2011/11/11-11-ifc-apple-shop-iphone4s/" title="11.11香港IFC苹果专卖店买iphone4s失败记">11.11香港IFC苹果专卖店买iphone4s失败记</a></li>
<li><a href="http://daozhao.goflytoday.com/2011/10/iphone4s/" title="Iphone4S你失望了么？">Iphone4S你失望了么？</a></li>
<li><a href="http://daozhao.goflytoday.com/2010/12/htc-legend-upgrade-andriod-2-2/" title="htc legend升级andriod 2.2失望中">htc legend升级andriod 2.2失望中</a></li>
<li><a href="http://daozhao.goflytoday.com/2010/09/wo-iphone4-price/" title="联通iphone4价格分析">联通iphone4价格分析</a></li>
<li><a href="http://daozhao.goflytoday.com/2010/05/iphone4g-price/" title="第4代iphone价格随想">第4代iphone价格随想</a></li>
</ul>
<div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://daozhao.goflytoday.com/2010/01/jqtouch-use-and-bug/' addthis:title='jqtouch使用和bug '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://daozhao.goflytoday.com/2010/01/jqtouch-use-and-bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

