<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
	<title>jQuery</title>
	<link>http://blog.roodo.com/rss20/topic/topic_article_18029.xml</link>
	<description>jQuery javascript framework.</description>
	<language>zh-tw</language>
	<generator>Roodo Blog System</generator>
	<copyright>All Rights Reserved</copyright>
	<item>
		<title>jquery 與 iframe / Thinking more...</title>
		<description>假設 iframe 的 id 是 f，裡面有個按鈕 id 是 btn，那麼要存取 iframe 裡的元素，可以這樣寫：
 
  // http://simple.procoding.net/2008/03/21/how-to-access-iframe-in-jquery/
  alert( $(&#039;#f&#039;).contents().find(&#039;#btn&#039;).html() );
 

再假設父頁面裡有個 id 是 ta 的 text，iframe 裡要存取父頁面裡的元素，有兩種寫法：
 
  // 方法一 (http://webdevel.blogspot.com/2007/03/iframes-and-jquery-working-with-iframes.html)
  alert( parent.$(&quot;#ta&quot;).val() );
  // 方法二 (http://groups.google.com/group/jquery-en/browse_thread/thread/5997ef4a60a123af?pli=1)
  alert( $(&quot;#ta&quot;, parent.document.body).val() );
 

不過，在碰到 cross domain 的情況時，就會行不通了。拜  Google 大神  的時候，大神有提到一些 解 ，但我嫌麻煩就沒再去試了... 

參考資料：   simple » Blog Archive » How to access iframe in jQuery    Web Developer Blog: Iframes and jQuery - Working with an iframe&#039;s parent    Using JQuery Effects in Parent Window from iFrame? - jQuery (English) | Google 網上論壇   
</description>
		<link>http://blog.roodo.com/thinkingmore/archives/9657289.html</link>
		<author>info@blog.roodo.com&lt;info@blog.roodo.com&gt;</author>
		<category>網路/3C</category>
		<pubDate>Tue, 04 Aug 2009 16:40:52 +0800</pubDate>
					</item>
	<item>
		<title>當 jQuery().ajax() 遇到 ASP / Thinking more...</title>
		<description>利用  jqGrid  新增中文欄位資料時，到伺服器端時，就變成亂碼了。 
請  FireBug  大神幫忙，發現 request header content-type 的編碼是 utf-8，查過 jqGrid 的 source code，裡面也只是調用  jQuery  的 ajax 函數而已。 
照理來說，應該可以用  $.ajaxSetup()  來修正，但試了好一陣子，發現沒辦法，即使我在 contentType 裡指定了 charset=big5，最後送出時，仍然會是 utf-8... 
 
好吧，山不轉路轉，再拜請 Google 大神，發現 有人利用 escape() 解 ，也就是先用 javascript escape() 編碼，server 端再解碼，這樣就解了。 
大致的代碼是這樣： //
$(&quot;#jqGrid2&quot;).jqGrid( 
  // ... 略 ...
).navGrid( &quot;#pager2&quot;, {
  // ... 略 ...
  add:true,
  addfunc: function() {
    $(&quot;#jqGrid2&quot;).editGridRow( &quot;new&quot;, {
      url: &quot;server.asp&quot;,
      beforeSubmit: function( postdata, o ) {
        var s = postdata[ &quot;your_field_name&quot; ];
        var ret=[true, &quot;&quot;, &quot;&quot;];
        postdata[ &quot;your_field_name&quot; ] = escape( s );
        return ret;
      }
    } );
    return false;
  }
} );
 

</description>
		<link>http://blog.roodo.com/thinkingmore/archives/8295421.html</link>
		<author>info@blog.roodo.com&lt;info@blog.roodo.com&gt;</author>
		<category>網路/3C</category>
		<pubDate>Fri, 13 Feb 2009 02:20:36 +0800</pubDate>
					</item>
	<item>
		<title>plugin_syntaxhighlighter / Thinking more...</title>
		<description>在  blogger  使用  dp.syntaxhighlighter  的話，你會發現根本無法生效，主要是因為  blogger  把換行符號都替換成 &amp;lt;br/&amp;gt; 了，而且還沒有設定可以決定是否要替換。 
很幸運地，有人已經提出解決方法： yehyeh: Blogger dp.SyntaxHighlighter斷行問題解決方法  
 
只是，我已經套用 blogger-ext2 了，於是想說，是不是可以寫一個 blogger-ext2 的 plugin 來解決這個問題。 
非常感謝 jQuery 的強大功能，不到半天就完成了，最重要的是，不用像上面解決方法一樣，寫了一堆 code。 
 
// Register dp.SyntaxHighLighter
// Dependency:
//   jQuery-1.2.1
//   blogger-ext2-core (最新版，0.7.x 的樣子)
//   dp.syntaxhighlighter-1.5.1
BloggerExt.SH = function() {
  // Plugin 會由此開始
  if( dp!=&#039;undefined&#039; ) {
    // 找到 pre, textarea 下所有 br，然後替換成換行符號，收工。
    jQuery(&quot;pre &gt; br&quot;).each( function() { jQuery(this).replaceWith( &quot;\n&quot; ); } );
    jQuery(&quot;textarea &gt; br&quot;).each( function() { jQuery(this).replaceWith( &quot;\n&quot; ); } );
    dp.SyntaxHighlighter.ClipboardSwf = &#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/clipboard.swf&#039;;
    dp.SyntaxHighlighter.HighlightAll(&#039;code&#039;);
  }
};
BloggerExt.SH.user_pref = function() {
	var prefs = [];
	return prefs;
};
BloggerExt.SH.update_pref = function(prefs) {
};
BloggerExt.register(&#039;SH&#039;, { SH: true} );
 
 
使用範例：
 
  &amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.2.1.pack.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script src=&quot;blogger_ext2.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shCore.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushCSharp.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushVb.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushPhp.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushJScript.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushSql.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushXml.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushPython.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushCss.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;http://syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/shBrushCpp.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;!--假設你已經把上面代碼存為 plugin_syntaxhighlighter.js 了 --&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&#039;plugin_syntaxhighlighter.js&#039;&amp;gt;&amp;lt;/script&amp;gt;
 
</description>
		<link>http://blog.roodo.com/thinkingmore/archives/4685373.html</link>
		<author>info@blog.roodo.com&lt;info@blog.roodo.com&gt;</author>
		<category>網路/3C</category>
		<pubDate>Wed, 19 Dec 2007 17:44:01 +0800</pubDate>
					</item>
	<item>
		<title>Test Smiley... / racklin</title>
		<description>Test Smiley summary :D 
  :p</description>
		<link>http://blog.roodo.com/racklin/archives/2732715.html</link>
		<author>info@blog.roodo.com&lt;info@blog.roodo.com&gt;</author>
		<category>網路/3C</category>
		<pubDate>Thu, 15 Feb 2007 21:22:22 +0800</pubDate>
					</item>
</channel>
</rss>