<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>@lice</title>
		<link>http://diary.tw/alice/</link>
		<description>blah blah blah</description>
		<language>zh-TW</language>
		<pubDate>Mon, 02 Jan 2012 15:20:03 +0800</pubDate>
		<generator>Tattertools 1.1.1 : Vivace</generator>
		<image>
		<title>@lice</title>
		<url>http://diary.tw/alice/attach/11/1223203326.gif</url>
		<link>http://diary.tw/alice/</link>
		<width>161</width>
		<height>307</height>
		<description>blah blah blah</description>
		</image>
		<item>
			<title>The executable was signed with invalid entitlements</title>
			<link>http://diary.tw/alice/978</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 4 times &lt;/span&gt;&lt;br /&gt;這三個月快被apple搞屎了, 先是申請開發者帳號一波八百折&lt;br /&gt;終於作好了被指示要加 in-app-purchase, 因為上頭常常朝令夕改一直不敢下去作關於&quot;帳&quot;的設定&lt;br /&gt;(它很多設定都不能改的, 上頭那八百折其中有兩百折就是因為那樣)&lt;br /&gt;===== 中間改了一次版面的分隔線 =====&lt;br /&gt;還好最後決定先以完全免費的方式先上架亮亮相, 結果submit上去被說是&quot;&lt;span class=&quot;st&quot;&gt;Invalid Binary&lt;/span&gt;&lt;span class=&quot;st&quot;&gt;&lt;/span&gt;&quot;&lt;br /&gt;找了一個最簡單的解決方法就是把XCode3升到4...沒想到是另一個惡夢的開始(簡單個屁)&lt;br /&gt;Build下去變三百多個error....orz&lt;br /&gt;因為都是Three20來的, 把很多沒用到的script蓋掉卻越錯越多, 最後乾脆抓一個新版的來重裝才解決掉問題&lt;br /&gt;(有夠痛恨這種又大又肥, 更新後毛病一大堆的東西)&lt;br /&gt;(而且XCode3到4也變太多, google找到的說明畫面都不一樣)&lt;br /&gt;好不容易邊摸索新介面找到地方上架卻得到&quot;mutiple bundle&quot;的錯誤, 一查之下又是Three20的問題, 要把們的&quot;Skip Install&quot;都設為&quot;Yes&quot;才行&lt;br /&gt;問題還沒完, 最後變成Xcode升級後不能在手機上執行一樣的錯誤&quot;The executable was signed with invalid entitlements&quot;&lt;br /&gt;明明在上一版本都可以升級就不行是什麼道理, 最後查到原來XCode4根本可以不需要Entitlements Files(*.plist)&lt;br /&gt;想想它的那些key轉到這個版本時好像變怪怪的, 說不定是就是找不到東西的緣故&lt;br /&gt;果然把它刪掉就好了 orz&lt;br /&gt;目前&lt;span class=&quot;st&quot;&gt;&quot;Waiting for review&quot;的狀態, 希望不要再有問題了啊啊啊~~~&lt;br /&gt;&lt;/span&gt;</description>
			<category>新發現</category>
			<category>app</category>
			<category>apple</category>
			<category>iphone</category>
			<category>xcode</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/978</guid>
			<comments>http://diary.tw/alice/978#entry978comment</comments>
			<pubDate>Mon, 02 Jan 2012 15:09:24 +0800</pubDate>
		</item>
		<item>
			<title>[jquery]按enter移到下一個輸入欄位</title>
			<link>http://diary.tw/alice/956</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 1898 times &lt;/span&gt;&lt;br /&gt;jquery的最大作用在於增加ui的好用程度, 幾乎沒有辦不到的, 也因此對一些特殊需求就只能當作挑戰吞下去了&lt;br /&gt;例如在form裡的text輸入欄位按enter要能跳到下一個欄位, 聽起來很簡單但其實沒那麼單純(其實是因為我龜毛想寫的更漂亮)&lt;br /&gt;找了很久終於找到很讚的寫法:&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;Cpp&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;
$(function() {
	$(&quot;input[type=text]&quot;).keydown(function(event){
	  if(event.keyCode == 13){
	    $(this).nextAll(&quot;input[type=text]:first&quot;).focus();
	  }
	});
}
&lt;/textarea&gt;&lt;br /&gt;</description>
			<category>新發現</category>
			<category>form</category>
			<category>javascript</category>
			<category>jQuery</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/956</guid>
			<comments>http://diary.tw/alice/956#entry956comment</comments>
			<pubDate>Thu, 21 Jul 2011 16:04:04 +0800</pubDate>
		</item>
		<item>
			<title>Facebook 小工具的額外控制</title>
			<link>http://diary.tw/alice/931</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 3933 times &lt;/span&gt;&lt;br /&gt;Facebook小工具(&lt;a href=&quot;http://developers.facebook.com/docs/plugins/&quot; target=&quot;_blank&quot;&gt;Social Plugins&lt;/a&gt;)己被廣泛使用了兩年多&lt;br /&gt;但被嵌入網站的管理者對於user使用這些工具的行為似乎無從介入, 也沒法把這個資訊跟網站內容作整合與統計&lt;br /&gt;其實它是可以作到的, 前提是...&lt;br /&gt;1. &lt;a href=&quot;http://www.facebook.com/developers/apps.php&quot; target=&quot;_blank&quot;&gt;建立facebook app&lt;/a&gt; 以取得app id&lt;br /&gt;2. 以&lt;a href=&quot;http://developers.facebook.com/docs/reference/javascript/&quot; target=&quot;_blank&quot;&gt; JavaScript SDK&lt;/a&gt; 的方式來嵌入小工具(而不是用iFrame)&lt;br /&gt;&lt;br /&gt;接著重點來了, 使用 &lt;a href=&quot;http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/&quot; target=&quot;_blank&quot;&gt;FB.Event.subscribe&lt;/a&gt; 來監控user對於facebook工具的行為, 以使用率最高的&quot;讚&quot;按鈕來說, 用法如下:&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;Cpp&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;FB.Event.subscribe(&#039;edge.create&#039;, function(href) {
	alert(&#039;謝謝你喜歡&#039;+href);
});&lt;/textarea&gt;&lt;br /&gt;也可以把alert那行替換成以下這行, 就是目前&lt;span style=&quot;text-decoration: line-through;&quot;&gt;最討人厭&lt;/span&gt;流行的按了讚才能看的功能:&lt;br /&gt;window.location = href+&quot;?action=liked&quot;; &lt;br /&gt;跟&quot;讚&quot;有關的Event有以下兩個, 其它可參考 &lt;a href=&quot;http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/&quot; target=&quot;_blank&quot;&gt;FB.Event.subscribe&lt;/a&gt;說明...&lt;ul&gt;&lt;li&gt;edge.create -- 當使用者按了&quot;讚&quot;&lt;/li&gt;&lt;li&gt;edge.remove -- 當使用者取消按&quot;讚&quot;&lt;/li&gt;&lt;/ul&gt;使用&lt;a href=&quot;http://developers.facebook.com/docs/reference/javascript/&quot; target=&quot;_blank&quot;&gt; JavaScript SDK&lt;/a&gt; 很方便又功能多多, 而且對於無法使用server site code的網站管理者是一個很好的選擇...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
			<category>新發現</category>
			<category>facebook</category>
			<category>javascript</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/931</guid>
			<comments>http://diary.tw/alice/931#entry931comment</comments>
			<pubDate>Thu, 17 Mar 2011 12:19:15 +0800</pubDate>
		</item>
		<item>
			<title>Facebook Graph Api 初試</title>
			<link>http://diary.tw/alice/930</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 5546 times &lt;/span&gt;&lt;br /&gt;Facebook去年推出的&lt;a href=&quot;http://developers.facebook.com/docs/reference/api/&quot; target=&quot;_blank&quot;&gt;Graph Api&lt;/a&gt;引起一陣嘩然, 因為它功能強大而且非常容易套用到各網站中&lt;br /&gt;難怪有人說網路的世界都快被facebook統一, 而個資也越來越越藏不住了...&lt;br /&gt;&lt;br /&gt;由於某些原因我開始嘗試使用, 沒想到一行code都不用寫就可以玩了, 以下是我的步驟:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://www.facebook.com/developers/apps.php&quot; target=&quot;_blank&quot;&gt;申請facebook api&lt;/a&gt;: 現在已經需要手機或信用卡認證才可以申請了&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;請user前往以下網址同意您的app存取他的fb資料 ...&lt;a href=&quot;http://developers.facebook.com/docs/authentication/&quot; target=&quot;_blank&quot;&gt;參考資料&lt;/a&gt;&lt;br /&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(201, 237, 255);&quot;&gt;https://www.facebook.com/dialog/oauth?client_id=123456789&amp;amp;redirect_uri=http://myweb.com&amp;amp;scope=read_stream,offline_access&lt;/div&gt;client_id : App id&lt;br /&gt;scope : 授權範圍為read_stream(讀取塗鴉牆), offline_access(離線存取) ...&lt;a href=&quot;http://developers.facebook.com/docs/authentication/permissions/&quot; target=&quot;_blank&quot;&gt;參考資料&lt;/a&gt;&lt;br /&gt;redirect_uri : call back url, 接收回傳授權碼的程式, 回傳參數為code, 型態為get參數&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;拿授權碼去拿access token, 往後就可以用這個access token來在授權範圍中作資料查詢&lt;br /&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(201, 237, 255);&quot;&gt;https://graph.facebook.com/oauth/access_token?client_id=123456789&amp;amp;redirect_uri=http://myweb.com/&amp;amp;client_secret=we9t8-wert9we7- 0w9e8t&amp;amp;code=[上項取得的code]&lt;/div&gt;client_id&amp;nbsp; : App id&lt;br /&gt;client_secret : App secret&lt;br /&gt;code : user授權碼(code)&lt;br /&gt;redirect_uri&amp;nbsp; : call back url, 接收回傳access token的程式, 回傳參數為access_token, 型態為page content(若為default文件記得最後要有&quot;/&quot;)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;然就可以httprequest的方式使用facebook api了, 回傳格式為json, 以下為幾個使用範例:&lt;p&gt;a. &amp;nbsp; &amp;nbsp;個人資料&lt;br /&gt;https://graph.facebook.com/me?access_token=[access_token]&lt;br /&gt;b. &amp;nbsp; &amp;nbsp;塗鴉牆&lt;br /&gt;https://graph.facebook.com/me/home?access_token=[access_token]&lt;br /&gt;c. &amp;nbsp; &amp;nbsp;塗鴉牆上某篇detail&lt;br /&gt;https://graph.facebook.com/[post_id]?access_token=[access_token]&lt;br /&gt;d. &amp;nbsp; &amp;nbsp;塗鴉牆上某篇留言&lt;br /&gt;https://graph.facebook.com[post_id]/comments?access_token=[access_token]&lt;br /&gt;一次列25筆,若要變更可在query後面加上 limit=xxx (可先從上項取得留言數再設定)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Graph Api使用說明: &lt;a href=&quot;http://developers.facebook.com/docs/reference/api/&quot; target=&quot;_blank&quot;&gt;http://developers.facebook.com/docs/reference/api/&lt;/a&gt;&lt;br /&gt;</description>
			<category>新發現</category>
			<category>facebook</category>
			<category>graph api</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/930</guid>
			<comments>http://diary.tw/alice/930#entry930comment</comments>
			<pubDate>Tue, 15 Mar 2011 15:38:45 +0800</pubDate>
		</item>
		<item>
			<title>透過OAuth使用twitter api(c#)</title>
			<link>http://diary.tw/alice/904</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 5848 times &lt;/span&gt;&lt;br /&gt;2010/9開始 Twitter 停用了先前簡易的 api 存取方式, 讓沒注意到的使用者一陣錯愕&lt;br /&gt;新的流程與以往有很大的不同, 首先要到&lt;span style=&quot;text-decoration: underline;&quot;&gt; &lt;/span&gt;Twitter &lt;a href=&quot;http://dev.twitter.com/apps/new&quot; target=&quot;_blank&quot;&gt;註冊一個api&lt;/a&gt;&lt;br /&gt;註冊完成會得到三組 key, 分別是:&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 51, 153); font-weight: bold;&quot;&gt;API key&lt;/span&gt; / &lt;span style=&quot;color: rgb(255, 51, 153); font-weight: bold;&quot;&gt;Consumer key&lt;/span&gt; / &lt;span style=&quot;color: rgb(255, 51, 153); font-weight: bold;&quot;&gt;Consumer secret&lt;/span&gt;&lt;br /&gt;我使用的是&lt;a href=&quot;http://code.google.com/p/oauth-dot-net/&quot; target=&quot;_blank&quot;&gt;oauth-dot-net&lt;/a&gt; library, &lt;a href=&quot;http://code.google.com/p/oauth-dot-net/&quot; target=&quot;_blank&quot;&gt;在google code裡可以下載&lt;/a&gt;, 它主要幫我們作訊息加密/重組與傳送/接收回傳值的工作&lt;br /&gt;記得使用前要把&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;Consumer key&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;與&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;Consumer secret&lt;/span&gt;改為自己的設定&lt;br /&gt;&lt;p id=&quot;more904_0&quot; class=&quot;moreless_fold&quot;&gt;&lt;span style=&quot;cursor: pointer;&quot; onclick=&quot;toggleMoreLess(this, &#039;904_0&#039;,&#039; more.. &#039;,&#039; less.. &#039;); return false;&quot;&gt; more.. &lt;/span&gt;&lt;/p&gt;&lt;div id=&quot;content904_0&quot; class=&quot;moreless_content&quot; style=&quot;display: none;&quot;&gt; &lt;br /&gt;一. 不管使用api的什麼功能, 首先都要先讓user同意該api存取他的資料, 這個動作叫作授權, &lt;a href=&quot;http://dev.twitter.com/pages/sign_in_with_twitter&quot; target=&quot;_blank&quot;&gt;這裡&lt;/a&gt;有對授權流程的詳細解說...&lt;br /&gt;twitterauth_process.ashx的程式如下&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;Cpp&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;
  const string url = &quot;http://twitter.com/account/verify_credentials.xml&quot;;
  const string callbackurl = &quot;http://demo.com/finish.aspx&quot;; //完成授權後的頁面
  public void ProcessRequest(HttpContext context)
  {
    context.Response.ContentType = &quot;text/plain&quot;;
    context.Response.Charset = &quot;UTF-8&quot;;
    TwitterApi.oAuthTwitter oAuth = new TwitterApi.oAuthTwitter();
    if (context.Request[&quot;oauth_token&quot;] == null)
    {//登入或請求授權頁
      oAuth.CallBackUrl = &quot;http://demo.com/twitterauth_process.ashx?m=&quot; + context.Request[&quot;m&quot;].ToString(); //可自行帶參數
      context.Response.Redirect(oAuth.AuthorizationLinkGet());
    }    else    {
      //user接受授權回傳資料頁
      oAuth.AccessTokenGet(context.Request[&quot;oauth_token&quot;], context.Request[&quot;oauth_verifier&quot;]);
      if (oAuth.TokenSecret.Length &amp;gt; 0)
      {
        //We now have the credentials, so make a call to the Twitter API.
        try
        {
          string xml = oAuth.oAuthWebRequest(TwitterApi.oAuthTwitter.Method.GET, url, String.Empty);
          if (!string.IsNullOrEmpty(xml))
          {
            //儲存 oAuth.Token, oAuth.OAuthVerifier, oAuth.TokenSecret 三個值, 注意oAuth.Token, oAuth.OAuthVerifier與回傳的&quot;oauth_token&quot; / &quot;oauth_verifier&quot;並不相同, 所以不可直接把後者拿來使用
            //取得xml中的&quot;user/id&quot;, &quot;user/name&quot;, &quot;user/screen_name&quot;等相關資料
          }    else     {
            err = &quot;twitter error&quot;;
          }
        }
        catch (System.Net.WebException ex)
        {
          err = ((System.Net.HttpWebResponse)ex.Response).StatusCode.ToString();
        }
      }
    }
    context.Response.Redirect(callbackurl); //回到完成頁
}&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;二. user接受授權後我們會得到該user對此api專屬的三組key, 分別是:&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 118, 53); font-weight: bold;&quot;&gt;Token&lt;/span&gt; / &lt;span style=&quot;color: rgb(255, 118, 53); font-weight: bold;&quot;&gt;OAuthVerifier &lt;/span&gt;/ &lt;span style=&quot;color: rgb(255, 118, 53); font-weight: bold;&quot;&gt;TokenSecret&lt;/span&gt;&lt;br /&gt;有了上面三個認證資料, 接下來update status這個動作就單純多了&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;Cpp&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;
                  TwitterApi.oAuthTwitter oAuth = new TwitterApi.oAuthTwitter();
                  oAuth.Token = Request[&quot;oauth_token&quot;].Trim();
                  oAuth.OAuthVerifier = Request[&quot;oauth_verifier&quot;].Trim();
                  oAuth.TokenSecret = Request[&quot;oauth_secret&quot;].Trim();
                  try
                  {
                    string url = &quot;http://twitter.com/statuses/update.xml&quot;;
                    string xml = oAuth.oAuthWebRequest(TwitterApi.oAuthTwitter.Method.POST, url, &quot;status=&quot; + oAuth.UrlEncode(Request[&quot;twitter_msg&quot;].Trim()));
                    //取得xml中&quot;status/id&quot;
                  }
                  catch (System.Net.WebException ex)
                  {
                    sApiMsg = (((System.Net.HttpWebResponse)ex.Response).StatusCode).ToString();
                  }&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;三. 最後替換掉OAuth.cs裡UrlEncode的方法&lt;br /&gt;因為library 是老外寫的, 所以沒有考慮到multibyte的問題, 有幾個熱心網友馬上提出solution供大家使用&lt;br /&gt;例如這個: &lt;a href=&quot;http://ithoughthecamewithyou.com/post/Space-and-multibyte-character-encoding-for-posting-to-Twitter-using-OAuth.aspx&quot; target=&quot;_blank&quot;&gt;Space and multibyte character encoding for posting to Twitter using OAuth&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 與這個: &lt;a href=&quot;http://blog.stephendenton.com/code/a-proper-urlencode-function-for-oauth-in-c-sharp/&quot; target=&quot;_blank&quot;&gt;A Proper UrlEncode Function for oAuth in C#&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;</description>
			<category>新發現</category>
			<category>c#</category>
			<category>oauth</category>
			<category>twitter</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/904</guid>
			<comments>http://diary.tw/alice/904#entry904comment</comments>
			<pubDate>Mon, 27 Sep 2010 14:34:00 +0800</pubDate>
		</item>
		<item>
			<title>Bounce - 輕鬆分享網頁</title>
			<link>http://diary.tw/alice/886</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 5203 times &lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.bounceapp.com/&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://alice.mac.to/for_diary/bounce.png&quot;&gt;&lt;/a&gt;&lt;br /&gt;在plurk看到朋友的分享, 覺得很實用&lt;br /&gt;輸入網址後它會取得該網頁的截圖, 重點來了, 它可以讓你為標示的區塊作註解, 並以網址的方式分享給友人&lt;br /&gt;以下是我試作的分享網頁:&lt;br /&gt;&lt;a href=&quot;http://www.bounceapp.com/2253&quot; target=&quot;_blank&quot;&gt;http://www.bounceapp.com/2253&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;跟我目前瀏覽器外掛的fireshot差別是, 以網址分享更方便&lt;br /&gt;有機會可以試試哦~&lt;br /&gt;&lt;br /&gt;資料來源: &lt;a href=&quot;http://ka-yue.com/blog/bounce-%E8%BC%95%E9%AC%86%E5%9C%A8%E7%B6%B2%E9%A0%81%E4%B8%8A%E5%8A%A0%E6%B3%A8%E9%87%8B&quot; target=&quot;_blank&quot;&gt;Bounce - 輕鬆在網頁上加注釋&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</description>
			<category>新發現</category>
			<category>Web</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/886</guid>
			<comments>http://diary.tw/alice/886#entry886comment</comments>
			<pubDate>Fri, 25 Jun 2010 15:24:40 +0800</pubDate>
		</item>
		<item>
			<title>jquery動態產生連結的幾個方法</title>
			<link>http://diary.tw/alice/851</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 8306 times &lt;/span&gt;&lt;br /&gt;1,2 是不需要JQuery的基本方法&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;html&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;&lt;a href=&quot;http://www.google.com&quot; target=&quot;_blank&quot;&gt;link 1 - google&lt;/a&gt;
&lt;div onclick=&quot;window.open(&#039;http://tw.yahoo.com&#039;);&quot;&gt;link 2 - yahoo&lt;/div&gt;&lt;/textarea&gt;&lt;br /&gt;當連結目標是動態產生時可用下列三種方法&lt;br /&gt;html部份-&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;html&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;&lt;div id=&quot;aa&quot;&gt;link 3 - imtv&lt;/div&gt;
&lt;div id=&quot;bb&quot;&gt;link 4 - youtube&lt;/div&gt;
&lt;div id=&quot;cc&quot;&gt;link 5 - yam&lt;/div&gt;
&lt;form action=&quot;&quot; method=&quot;get&quot; id=&quot;tmpform&quot; target=&quot;_blank&quot; style=&quot;margin:0px;&quot;&gt;&lt;/form&gt;
&lt;/textarea&gt;&lt;br /&gt;javascript部份-&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;javascript&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;
	$(&quot;#aa&quot;).click(function(){
		window.open(&quot;http://www.im.tv&quot;,&quot;mywindow&quot;);
	});
	var aa = $(&#039;＜a＞＜a＞&#039;);
	aa.attr({ 
		href:&quot;http://www.youtube.com&quot;,
		target:&quot;_blank&quot;
	});
	$(&quot;#bb&quot;).wrapInner(aa);		
	$(&quot;#cc&quot;).click(function(){
		$(&quot;#tmpform&quot;).attr(&#039;action&#039;,&#039;http://www.yam.com&#039;);
		$(&quot;#tmpform&quot;).submit();
	});&lt;/textarea&gt;&lt;span style=&quot;color: #993366&quot;&gt;*第4行的＜＞符號請自行轉換為半形&lt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;奇妙的是某些版本的ie6對方法3,5是失效的, 查了半天只查到這個說明:&lt;br /&gt;&lt;a href=&quot;http://support.microsoft.com/kb/281679&quot; target=&quot;_blank&quot;&gt;您無法開啟新的 Internet Explorer Window，或按一下連結後未執行任何動作&lt;/a&gt;&lt;br /&gt;遇到這個狀況時, 把方法3的window.open改成location.href就沒問題了~&lt;br /&gt;</description>
			<category>新發現</category>
			<category>javascript</category>
			<category>jQuery</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/851</guid>
			<comments>http://diary.tw/alice/851#entry851comment</comments>
			<pubDate>Tue, 17 Nov 2009 12:37:39 +0800</pubDate>
		</item>
		<item>
			<title>破圖的處理</title>
			<link>http://diary.tw/alice/838</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 8593 times &lt;/span&gt;&lt;br /&gt;網頁有引用到外站的圖片, 但圖片不復存在時通常會看到一個所謂的破圖&lt;br /&gt;若想要保持版面的完整與美觀, 可以動態以別的圖片代替&lt;br /&gt;在圖片加上onerror屬性:&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;html&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;&lt;img src=&quot;myimage.jpg&quot; onerror=&quot;ImgError(this);&quot;&gt;&lt;/textarea&gt;&lt;br /&gt;再用javascript寫一個置換圖片的function&lt;br /&gt;&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;javascript&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;function ImgError(source){
    source.src = &quot;img/default_image.jpg&quot;;
    source.onerror = &quot;&quot;;
    return true;
}&lt;/textarea&gt;&lt;br /&gt;這樣在圖片load不到時就會改顯示你設定的替代圖片了~&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;參考來源: &lt;a href=&quot;http://stackoverflow.com/questions/92720/jquery-javascript-to-replace-broken-images&quot; target=&quot;_blank&quot;&gt;jQuery/Javascript to replace broken images&lt;/a&gt;&lt;br /&gt;</description>
			<category>新發現</category>
			<category>html</category>
			<category>image</category>
			<category>javascript</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/838</guid>
			<comments>http://diary.tw/alice/838#entry838comment</comments>
			<pubDate>Tue, 29 Sep 2009 16:25:16 +0800</pubDate>
		</item>
		<item>
			<title>用JQuery依序展示效果</title>
			<link>http://diary.tw/alice/820</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 9135 times &lt;/span&gt;&lt;br /&gt;若想讓一個以上的物件, 一個接一個的表現出slide或fade等效果時&lt;br /&gt;直覺的作法是:&lt;br /&gt;
&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;javascript&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;function slideImg1(){
  for(b=0;b&lt;ImgCount;b++){
    $(&quot;.slide1&quot;).eq(b).slideDown(&#039;slow&#039;); 
  }
}&lt;/textarea&gt;
&lt;br /&gt;&lt;br /&gt;但不管效果的速度改的多慢,或甚至用到setTimeout或setInterval它最後都會一起出來&lt;br /&gt;研究出的結果是要善用它on complate 的callback參數:&lt;br /&gt;
&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;javascript&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;function slideImg2(){
	if(ImgIndex&lt;ImgCount){
		$(&quot;.slide2&quot;).eq(ImgIndex).slideDown(&#039;slow&#039;,slideImg2); 
		ImgIndex++;
	}
}&lt;/textarea&gt;
&lt;br /&gt;&lt;br /&gt;附上的sample加上了顯示進度的數字, 以方便更清楚的看出差別&lt;div class=&quot;imageblock left&quot; style=&quot;float: left; margin-right: 10px;&quot;&gt;&lt;a href=&quot;http://diary.tw/alice/attachment/1297575236.html&quot;&gt;&lt;img src=&quot;http://diary.tw/image/extension/html.gif&quot; /&gt; slide_onebyone.html&lt;/a&gt;&lt;/div&gt;</description>
			<category>新發現</category>
			<category>css</category>
			<category>javascript</category>
			<category>jQuery</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/820</guid>
			<comments>http://diary.tw/alice/820#entry820comment</comments>
			<pubDate>Thu, 20 Aug 2009 18:12:03 +0800</pubDate>
		</item>
		<item>
			<title>用JQuery來自製blink blink效果</title>
			<link>http://diary.tw/alice/813</link>
			<description>&lt;span class=&quot;c_cnt&quot;&gt;views: 10167 times &lt;/span&gt;&lt;br /&gt;有兩種方式
1. animate: 用callback方式呼叫自己, 反覆播放opacity(透明度)的變化
&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;javascript&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;function blinkblink1(){
	var opc = ($(&quot;#blinkobj1&quot;).css(&quot;opacity&quot;)==1)?0:1;
	$(&quot;#blinkobj1&quot;).animate({
	        opacity: opc
	}, 800, blinkblink1 );
}&lt;/textarea&gt;

2. 反覆使用fadein, fadeout功能
&lt;textarea name=&quot;CodeHighLighterCode&quot; class=&quot;javascript&quot; cols=&quot;60&quot; rows=&quot;10&quot; readonly=&quot;readonly&quot;&gt;function blinkblink2a(){
	$(&quot;#blinkobj2&quot;).fadeOut(&quot;slow&quot;,blinkblink2b);
}
function blinkblink2b(){
	$(&quot;#blinkobj2&quot;).fadeIn(&quot;fast&quot;,blinkblink2a);
}&lt;/textarea&gt;

效果請看這裡: &lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://diary.tw/alice/attachment/1382596732.html&quot;&gt;&lt;img src=&quot;http://diary.tw/image/extension/html.gif&quot; /&gt; blinkblink.html&lt;/a&gt;&lt;/div&gt;</description>
			<category>新發現</category>
			<category>css</category>
			<category>javascript</category>
			<category>jQuery</category>
			<category>Web</category>
			<author> (alice)</author>
			<guid>http://diary.tw/alice/813</guid>
			<comments>http://diary.tw/alice/813#entry813comment</comments>
			<pubDate>Thu, 06 Aug 2009 16:58:30 +0800</pubDate>
		</item>
	</channel>
</rss>

