<?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>Blog &#124; yusukekamiyamane &#187; code</title>
	<atom:link href="http://yusukekamiyamane.com/blog/categories/code/feed" rel="self" type="application/rss+xml" />
	<link>http://yusukekamiyamane.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 16 Jan 2012 08:29:51 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>相対日時表記に変換</title>
		<link>http://yusukekamiyamane.com/blog/archives/141</link>
		<comments>http://yusukekamiyamane.com/blog/archives/141#comments</comments>
		<pubDate>Wed, 17 Mar 2010 00:35:44 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com/blog/?p=141</guid>
		<description><![CDATA[PHPの場合。 function format_relative_date ($date) { $time = strtotime ($date); $second = time () - $time; if ($second < 60) { return ($second . "秒前"); } else if ($second < 3600) { return (intval ($second / 60) . "分前"); } else if ($second < 86400) { return ("約" . intval ($second / 3600) . "時間前"); } [...]]]></description>
			<content:encoded><![CDATA[<p>PHPの場合。</p>
<pre class="prettyprint">function format_relative_date ($date) {
  $time = strtotime ($date);
  $second = time () - $time;
  if ($second < 60) {
    return ($second . "秒前");
  } else if ($second < 3600) {
    return (intval ($second / 60) . "分前");
  } else if ($second < 86400) {
    return ("約" . intval ($second / 3600) . "時間前");
  } else {
    return (date ("m/d H:i", $time));
  }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/141/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>アイコン検索のAjax化</title>
		<link>http://yusukekamiyamane.com/blog/archives/97</link>
		<comments>http://yusukekamiyamane.com/blog/archives/97#comments</comments>
		<pubDate>Tue, 16 Mar 2010 03:02:04 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=97</guid>
		<description><![CDATA[した 。 jQueryのload関数、超便利ですね。]]></description>
			<content:encoded><![CDATA[<p><a href="http://p.yusukekamiyamane.com/icons/search/fugue/">した</a> 。</p>
<p>jQueryの<code>load</code>関数、超便利ですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/97/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>アイコン検索</title>
		<link>http://yusukekamiyamane.com/blog/archives/26</link>
		<comments>http://yusukekamiyamane.com/blog/archives/26#comments</comments>
		<pubDate>Wed, 24 Feb 2010 04:11:51 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=26</guid>
		<description><![CDATA[Fugue Icons Search を公開。 夜なべしてリファレンス系サイトと首っ引きでPHP書いた。適当でも動くもんだ。]]></description>
			<content:encoded><![CDATA[<p><a href="http://p.yusukekamiyamane.com/icons/search/fugue/">Fugue Icons Search</a> を公開。</p>
<p>夜なべしてリファレンス系サイトと首っ引きでPHP書いた。適当でも動くもんだ。</p>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/26/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>サイトの多言語対応化</title>
		<link>http://yusukekamiyamane.com/blog/archives/23</link>
		<comments>http://yusukekamiyamane.com/blog/archives/23#comments</comments>
		<pubDate>Fri, 19 Feb 2010 07:13:14 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=23</guid>
		<description><![CDATA[アイコンとかフォントのサイト を.htaccessをいじくってコンテントネゴシエーションで多言語対応化 (と言っても2言語だけだけど) した時のメモ。 Think ITの記事 を大いに参考にした。 英語版: index.html.en (デフォルト) 日本語版: index.html.ja AddLanguage ja .ja AddLanguage en .en Options +MultiViews ForceLanguagePriority Fallback LanguagePriority en ja SetEnvIf Cookie (^&#124;\s)lang=\"?(en&#124;ja)\"? prefer-language=$2 SetEnvIf Request_URI \.(en&#124;ja)$ prefer-language=$1 Header append Set-Cookie "lang=%{prefer-language}e;expires=Tue, 1-Jan-2030 00:00:00 GMT;path=/" env=prefer-language Header append Cache-Control no-cache 多分ちゃんと動いてる。]]></description>
			<content:encoded><![CDATA[<p><a href="http://p.yusukekamiyamane.com/">アイコンとかフォントのサイト</a> を.htaccessをいじくってコンテントネゴシエーションで多言語対応化 (と言っても2言語だけだけど) した時のメモ。</p>
<p><a href="http://thinkit.jp/article/608/2/" target="_blank">Think ITの記事</a> を大いに参考にした。</p>
<p>英語版: index.html.en (デフォルト)<br />
日本語版: index.html.ja</p>
<pre class="prettyprint">AddLanguage ja .ja
AddLanguage en .en
Options +MultiViews
ForceLanguagePriority Fallback
LanguagePriority en ja
SetEnvIf Cookie (^|\s)lang=\"?(en|ja)\"? prefer-language=$2
SetEnvIf Request_URI \.(en|ja)$ prefer-language=$1
Header append Set-Cookie "lang=%{prefer-language}e;expires=Tue, 1-Jan-2030 00:00:00 GMT;path=/" env=prefer-language
Header append Cache-Control no-cache</pre>
<p>多分ちゃんと動いてる。</p>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/23/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ブロック要素の高さを揃える</title>
		<link>http://yusukekamiyamane.com/blog/archives/19</link>
		<comments>http://yusukekamiyamane.com/blog/archives/19#comments</comments>
		<pubDate>Fri, 05 Dec 2008 03:35:02 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=19</guid>
		<description><![CDATA[高さというより下端だけど。 equal-bottom-nに対応する要素の下端を揃える。 サンプル $ (function () { for (var i = 1; $ (".equal-bottom-" + i).length; i++) { var block = $ (".equal-bottom-" + i); var height = 0; block.each (function () { height = Math.max ($ (this).offset ().top + $ (this).height (), height); }); block.each (function () { $ (this).height (height - $ (this).offset [...]]]></description>
			<content:encoded><![CDATA[<p>高さというより下端だけど。</p>
<p><code>equal-bottom-n</code>に対応する要素の下端を揃える。</p>
<p><a href="/blog/2008/12/05/sample/index.html" target="_blank">サンプル</a></p>
<pre class="prettyprint">$ (function () {
  for (var i = 1; $ (".equal-bottom-" + i).length; i++) {
    var block = $ (".equal-bottom-" + i);
    var height = 0;
    block.each (function () {
      height = Math.max ($ (this).offset ().top + $ (this).height (), height);
    });
    block.each (function () {
      $ (this).height (height - $ (this).offset ().top);
    });
  }
});</pre>
<p><span id="more-19"></span></p>
<pre class="prettyprint lang-css">div.box {
  border: 1px solid #000;
  margin-bottom: 20px;
  margin-top: 20px;
  padding: 10px;
}
div.grid {
  _height: 1%;
  *zoom: 1;
}
div.grid:after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}
div.grid div.column {
  float: left;
}
p {
  margin-bottom: 0;
  margin-top: 0;
}</pre>
<pre class="prettyprint">&lt;div class="grid"&gt;
  &lt;div class="column" style="margin-right: 20px; width: 200px;"&gt;
    &lt;div class="box equal-bottom-1"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="column" style="margin-right: 20px; width: 200px;"&gt;
    &lt;div class="box equal-bottom-1"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="column" style="width: 200px;"&gt;
    &lt;div class="box equal-bottom-1"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div class="grid"&gt;
  &lt;div class="column" style="margin-right: 20px; width: 200px;"&gt;
    &lt;div class="box"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
    &lt;div class="box equal-bottom-2"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="column" style="margin-right: 20px; width: 200px;"&gt;
    &lt;div class="box equal-bottom-2"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="column" style="width: 200px;"&gt;
    &lt;div class="box"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
    &lt;div class="box equal-bottom-2"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div class="grid"&gt;
  &lt;div class="column" style="margin-right: 20px; width: 200px;"&gt;
    &lt;div class="box"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
    &lt;div class="box"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
    &lt;div class="box equal-bottom-3"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;div class="box equal-bottom-4"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="column" style="margin-right: 20px; width: 200px;"&gt;
    &lt;div class="box equal-bottom-3"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
    &lt;div class="box equal-bottom-4"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="column" style="width: 200px;"&gt;
    &lt;div class="box equal-bottom-4"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/19/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>なんちゃってvalign</title>
		<link>http://yusukekamiyamane.com/blog/archives/18</link>
		<comments>http://yusukekamiyamane.com/blog/archives/18#comments</comments>
		<pubDate>Wed, 03 Dec 2008 23:01:41 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=18</guid>
		<description><![CDATA[やはり出来ると便利なので。 サンプル $ (function () { $ ("div.grid.middle &#62; div.column").addClass ("middle"); $ ("div.grid.bottom &#62; div.column").addClass ("bottom"); $ ("div.grid div.column").filter (".middle, .bottom").each (function () { var height = 0; $ (this).siblings ().each (function () { height = Math.max (height, $ (this).height ()); }); var margin = Math.max (height - $ (this).height (), 0); $ (this).css ("margin-top", [...]]]></description>
			<content:encoded><![CDATA[<p>やはり出来ると便利なので。</p>
<p><a href="/blog/2008/12/04/sample/index.html" target="_blank">サンプル</a></p>
<pre class="prettyprint">$ (function () {
  $ ("div.grid.middle &gt; div.column").addClass ("middle");
  $ ("div.grid.bottom &gt; div.column").addClass ("bottom");
  $ ("div.grid div.column").filter (".middle, .bottom").each (function () {
    var height = 0;
    $ (this).siblings ().each (function () {
      height = Math.max (height, $ (this).height ());
    });
    var margin = Math.max (height - $ (this).height (), 0);
    $ (this).css ("margin-top", ($ (this).hasClass ("middle") ? Math.floor (margin / 2) : margin) + "px");
  });
});</pre>
<p><span id="more-18"></span></p>
<pre class="prettyprint lang-css">div.grid {
  _height: 1%;
  *zoom: 1;
}
div.grid:after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}
div.grid div.column {
  float: left;
}</pre>
<pre class="prettyprint">&lt;div class="grid middle"&gt;
  &lt;div class="column" style="margin-right: 20px; width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;div class="column" style="margin-right: 20px; width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;div class="column" style="width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div class="grid bottom"&gt;
  &lt;div class="column" style="margin-right: 20px; width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;div class="column" style="margin-right: 20px; width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;div class="column" style="width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div class="grid"&gt;
  &lt;div class="column middle" style="margin-right: 20px; width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;div class="column" style="margin-right: 20px; width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
  &lt;div class="column bottom" style="width: 100px;"&gt;&lt;p&gt;ほげほげほげほげほげ...&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/18/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>テーブルのセルの中をいい感じに</title>
		<link>http://yusukekamiyamane.com/blog/archives/17</link>
		<comments>http://yusukekamiyamane.com/blog/archives/17#comments</comments>
		<pubDate>Tue, 18 Nov 2008 07:32:21 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=17</guid>
		<description><![CDATA[&#60;td&#62;&#60;ul /&#62;&#60;/td&#62;と&#60;td&#62;ほげほげ&#60;ul /&#62;&#60;/td&#62;、両方ともulが:first-childになるのは困ることが多いので:first-node疑似クラスを使えるようにする。 :-moz-first-nodeと同じ。 サンプル jQuery.extend (jQuery.expr [":"], { "first-node": function (a) { var b = a.parentNode.childNodes; for (var i = 0; i &#60; b.length; i++) { var c = b [i]; if (c.nodeType == 1) { return c.parentNode.getElementsByTagName ("*")[0] == a; } if (jQuery.trim (c.nodeValue)) { return false; } } return false; } }); [...]]]></description>
			<content:encoded><![CDATA[<p><code>&lt;td&gt;&lt;ul /&gt;&lt;/td&gt;</code>と<code>&lt;td&gt;ほげほげ&lt;ul /&gt;&lt;/td&gt;</code>、両方とも<code>ul</code>が<code>:first-child</code>になるのは困ることが多いので<code>:first-node</code>疑似クラスを使えるようにする。</p>
<p><code>:-moz-first-node</code>と同じ。</p>
<p><a href="/blog/2008/11/18/sample/index.html" target="_blank">サンプル</a></p>
<pre class="prettyprint">jQuery.extend (jQuery.expr [":"], {
  "first-node": function (a) {
    var b = a.parentNode.childNodes;
      for (var i = 0; i &lt; b.length; i++) {
      var c = b [i];
      if (c.nodeType == 1) {
        return c.parentNode.getElementsByTagName ("*")[0] == a;
      }
      if (jQuery.trim (c.nodeValue)) {
        return false;
      }
    }
    return false;
  }
});
$ (function () {
  $ ("td &gt; :first-node").addClass ("first-node-of-td");
});</pre>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/17/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>横幅不定のブロック要素を中央・右揃え</title>
		<link>http://yusukekamiyamane.com/blog/archives/16</link>
		<comments>http://yusukekamiyamane.com/blog/archives/16#comments</comments>
		<pubDate>Sat, 15 Nov 2008 02:00:50 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=16</guid>
		<description><![CDATA[要するに横幅を自動で設定してやるだけ。 サンプル $ (function () { $ (".left, .center, .right").each (function () { $ (this).css ({ display: "block", float: "none", width: $ (this).css ({ display: "inline-block", float: "left" }).width () }); }); }); .left { margin-left: 0; margin-right: auto; } .center { margin-left: auto; margin-right: auto; } .right { margin-left: auto; margin-right: 0; } &#60;ul [...]]]></description>
			<content:encoded><![CDATA[<p>要するに横幅を自動で設定してやるだけ。</p>
<p><a href="/blog/2008/11/15/sample/index.html" target="_blank">サンプル</a></p>
<pre class="prettyprint">$ (function () {
  $ (".left, .center, .right").each (function () {
    $ (this).css ({
      display: "block",
      float: "none",
      width: $ (this).css ({ display: "inline-block", float: "left" }).width ()
    });
  });
});</pre>
<p><span id="more-16"></span></p>
<pre class="prettyprint lang-css">.left {
  margin-left: 0;
  margin-right: auto;
}
.center {
  margin-left: auto;
  margin-right: auto;
}
.right {
  margin-left: auto;
  margin-right: 0;
}</pre>
<pre class="prettyprint">&lt;ul class="left"&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class="left"&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class="center"&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="center"&gt;ほげほげほげほげほげ...&lt;/li&gt;
&lt;/ul&gt;
&lt;ul class="right"&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li&gt;ほげほげほげほげほげ...&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
  &lt;li class="right"&gt;ほげほげほげほげほげ...&lt;/li&gt;
&lt;/ul&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ダイアログを出さずにウィンドウを閉じる</title>
		<link>http://yusukekamiyamane.com/blog/archives/15</link>
		<comments>http://yusukekamiyamane.com/blog/archives/15#comments</comments>
		<pubDate>Mon, 13 Oct 2008 07:29:08 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=15</guid>
		<description><![CDATA[window.open以外の方法で開いたウィンドウをwindow.closeで閉じるときに「ウィンドウは、表示中の&#8230;」というダイアログを出さずにウィンドウを閉じる。 将来にわたって問題ないのかどうかはあやしい。 サンプル window._close = window.close; window.close = function () { (window.open ("", "_top").opener = top)._close () }; &#60;a href="javascript:window.close ();"&#62;閉じる&#60;/a&#62;]]></description>
			<content:encoded><![CDATA[<p><code>window.open</code>以外の方法で開いたウィンドウを<code>window.close</code>で閉じるときに「ウィンドウは、表示中の&#8230;」というダイアログを出さずにウィンドウを閉じる。</p>
<p>将来にわたって問題ないのかどうかはあやしい。</p>
<p><a href="/blog/2008/10/12a/sample/index.html" target="_blank">サンプル</a></p>
<pre class="prettyprint">window._close = window.close;
window.close = function () {
  (window.open ("", "_top").opener = top)._close ()
};</pre>
<pre class="prettyprint">&lt;a href="javascript:window.close ();"&gt;閉じる&lt;/a&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/15/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>検索キーワードに関連するブログ記事リストを表示</title>
		<link>http://yusukekamiyamane.com/blog/archives/13</link>
		<comments>http://yusukekamiyamane.com/blog/archives/13#comments</comments>
		<pubDate>Thu, 02 Oct 2008 09:30:39 +0000</pubDate>
		<dc:creator>yusukekamiyamane</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://yusukekamiyamane.com.s88735.gridserver.com/blog/?p=13</guid>
		<description><![CDATA[JavaScriptで検索キーワードを取得 して、Google AJAX Search API にぶっこむだけ。 例: 当サイト。 Googleとかで「 Fugue Icons 」や「 jQuery 注釈リスト 」などと検索 検索結果からブログ記事を見る 右上とか、ホーム とか 検索キーワードはセッションCookieで保持。]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/?p=12">JavaScriptで検索キーワードを取得</a> して、<a href="http://code.google.com/intl/ja/apis/ajaxsearch/" target="_blank">Google AJAX Search API</a> にぶっこむだけ。</p>
<p>例:</p>
<p>当サイト。</p>
<ol>
<li>Googleとかで「 <a href="http://www.google.co.jp/search?hl=ja&amp;q=Fugue+Icons&amp;lr=lang_ja">Fugue Icons</a> 」や「 <a href="http://www.google.co.jp/search?hl=ja&amp;q=jQuery+%E6%B3%A8%E9%87%88%E3%83%AA%E3%82%B9%E3%83%88&amp;lr=lang_ja">jQuery 注釈リスト</a> 」などと検索</li>
<li>検索結果からブログ記事を見る</li>
<li>右上とか、<a href="http://yusukekamiyamane.com/">ホーム</a> とか</li>
</ol>
<p>検索キーワードはセッションCookieで保持。</p>
]]></content:encoded>
			<wfw:commentRss>http://yusukekamiyamane.com/blog/archives/13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

