<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Aerialarts &#187; javascript</title>
	<atom:link href="http://aerial.st/tags/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://aerial.st</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 01:27:51 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/tags/javascript/feed/" />
		<item>
		<title>Titanium Mobileでconsole.logを使う</title>
		<link>http://aerial.st/archive/2011/04/15/console-log-with-titanium/</link>
		<comments>http://aerial.st/archive/2011/04/15/console-log-with-titanium/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 05:57:48 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=1001</guid>
		<description><![CDATA[Titanium Mobileにはconsole.logが無いらしい。ぐぐってみたらTi.API.info()を使えばいいみたい。 var console = { log: function(str) { return Ti.API.info(str); } }; Ti.API.info()を直で使うべきなのかもなぁ。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/04/15/console-log-with-titanium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/04/15/console-log-with-titanium/" />
	</item>
		<item>
		<title>javascriptでcanvasに図形を描く</title>
		<link>http://aerial.st/archive/2011/01/22/draw-figures-on-canvas-with-javascript/</link>
		<comments>http://aerial.st/archive/2011/01/22/draw-figures-on-canvas-with-javascript/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 12:14:40 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=957</guid>
		<description><![CDATA[MDNのCanvasチュートリアルを参考にやってみた。 基本となるHTML： &#60;!DOCTYPE html&#62; &#60;html&#62; &#60;head&#62; &#60;meta name="charset" content="UTF-8"&#62; &#60;title&#62;canvas&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;canvas id="canvas1" width="100" height="100"&#62;&#60;/canvas&#62; &#60;script type="text/javascript" src="draw_figures.js"&#62;&#60;/script&#62; &#60;/body&#62; &#60;/html&#62; 以降、draw_figures.jsを変更していったと仮定する。 0. 座標系 原点は矩形の左上で、右方向がxの正方向、下方向がyの正方向になる。コンピュータの座標系としては一般的だと思われる（余談だけど、Mac OS XのCocoaは左下が原点なので上下が逆転していたりするので、若干面倒くさい） 0------ +x &#124; &#124; +y 1. 矩形を塗りつぶす var canvas = document.getElementById("canvas1"); if (canvas.getContext) { // 2D画像のコンテキストを取得 var ctx = canvas.getContext("2d") // 塗りつぶしの色のRGB値を(100,100,100)（灰色）に指定 ctx.fillStyle = "rgb(100,100,100)"; // 原点(0,0)を基準として、そこから+x方向に10px、+y方向に20pxをとった矩形領域を塗りつぶす ctx.fillRect(0,0,10,20); } 色の指定方法にはCSS3の色の指定方法がそのまま使える。 ctx.fillStyle = "orange"; ctx.fillStyle = "#FFA500"; ctx.fillStyle = "rgb(255,165,0)"; ctx.fillStyle = "rgba(255,165,0,1)"; // アルファ値を1にセット（透過しない） 2. 直線を描く var canvas = document.getElementById("canvas1"); if (canvas.getContext) { [...]]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/01/22/draw-figures-on-canvas-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/01/22/draw-figures-on-canvas-with-javascript/" />
	</item>
		<item>
		<title>jQuery.extend</title>
		<link>http://aerial.st/archive/2011/01/03/jquery-extend/</link>
		<comments>http://aerial.st/archive/2011/01/03/jquery-extend/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 16:36:25 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=879</guid>
		<description><![CDATA[WEB+DB Press No.60のjQueryに関する記事がとても面白かった。で、jQueryで提供されているextendの使い方を今になって理解してきたのでメモっておく。 jQuery.extendはRubyでいうところのHash#merge!だった。 var foo = { a: 1 } jQuery.extend(foo, { b: 2 }) //=> { a: 1, b: 2 } foo //=>{ a: 1, b: 2 } なので、次のようにするとハッシュ引数のデフォルト値の設定とかができて便利（Hash#reverse_merge的なこと）。 function foo(args) { args = jQuery.extend({ a: 1, b:2 }, args); : } ついでに、jQuery.extendはオブジェクトのコピーにも使える。ちゃんと見てないけどたぶん浅い。 var foo = { a: 1 } var bar = jQuery.extend({}, foo) //=> { a: 1 } ただしfooはFooのインスタンスだけど、barはObject直下のインスタンス（？）なのでFooをプロトタイプに持たないので要注意（用語がわからないけどこれで合ってるのかな）。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/01/03/jquery-extend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/01/03/jquery-extend/" />
	</item>
		<item>
		<title>jQuery Mobileではidが鬼門</title>
		<link>http://aerial.st/archive/2010/12/09/jquery-mobile-does-not-go-with-id-attribute/</link>
		<comments>http://aerial.st/archive/2010/12/09/jquery-mobile-does-not-go-with-id-attribute/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 14:32:40 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquerymobile]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=845</guid>
		<description><![CDATA[最近jQuery Mobileを触ることが多く、ちょこちょこハマりどころがあったのでメモしておく。 jQuery Mobileはリンクを遷移したときにハッシュ（URLの#以降の文字列）ごとにdata-role="page"な要素をAjaxで取得して既存のDOMツリーに追加する。 このため検索結果のページを行き来した場合などに、ハッシュが異なるにも関わらず元になるHTMLのテンプレートが同一なためにid属性値が重複してDOMツリー上に出現することがある。 こうなるとid属性値ではユニークな要素を指定することができず、それを前提としたDOM操作がまともに動作しなくなる。 そういうわけで、jQuery Mobileではid属性を使うことが結構鬼門だったりする。 代替手段としては、現在アクティブになっているpageのclass属性にui-page-activeが設定されることを利用して、これとユニークで指定したい要素に付与したclass属性値とのペアで指定する方法がある。 HTML： &#60;div data-role=&#34;page&#34;&#62; &#60;div data-role=&#34;content&#34;&#62; &#60;p class=&#34;hello&#34;&#62;I'm unique in this page!&#60;/p&#62; &#60;/div&#62; &#60;/div&#62; jQuery： var p = $(".ui-page-active .hello:first"); // 上述のp要素のjQueryオブジェクトを取得 console.log(p.html); // => I'm unique in this page! p[0]; // => HTMLParagraphElement（p要素のDOMオブジェクトを取得） こんなような、ユニークの要素を指定して処理をすることがよくあるんだけど、毎回毎回ui-page-activeとか書くのは面倒くさい。結構大きなハマりポイントだと思うけど、なにか簡単なAPIとかないのかな？]]></description>
		<wfw:commentRss>http://aerial.st/archive/2010/12/09/jquery-mobile-does-not-go-with-id-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2010/12/09/jquery-mobile-does-not-go-with-id-attribute/" />
	</item>
		<item>
		<title>JavascriptのArrayでeach,map,eachWithObject</title>
		<link>http://aerial.st/archive/2010/11/30/javascript-array-each-map-each-with-object/</link>
		<comments>http://aerial.st/archive/2010/11/30/javascript-array-each-map-each-with-object/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 13:21:30 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=828</guid>
		<description><![CDATA[Javascriptを触る機会があったのでちょっと試してみた。郷に入っては郷に従えというけれどJavascriptの流儀やAPIがわからなかったので、とりあえずArrayにeachとmap、eachWithObjectをくっつけてみた。 // [1,2,3].eachWithIndex(function(n,i) { console.log("#" + i + " = " + n)}) Array.prototype.eachWithIndex = function(func) { var length = this.length; for (var i = 0; i < length; i++) { func.apply(this, [this[i], i]); } return this; } // [1,2,3].each(function(n) { console.log(n) }) Array.prototype.each = function(func) { return this.eachWithIndex(function(x,i) { func.apply(this, [x]); }) } // [1,2,3].map(function(n) { return n * 2; }); Array.prototype.map = function(func) { var result = new Array(); this.eachWithIndex(function(x,i) { result.push(func.apply(this, [x])); }); return result; } // [...]]]></description>
		<wfw:commentRss>http://aerial.st/archive/2010/11/30/javascript-array-each-map-each-with-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2010/11/30/javascript-array-each-map-each-with-object/" />
	</item>
		<item>
		<title>2ch Star v0.2</title>
		<link>http://aerial.st/archive/2008/05/26/2ch-star-v02/</link>
		<comments>http://aerial.st/archive/2008/05/26/2ch-star-v02/#comments</comments>
		<pubDate>Sun, 25 May 2008 17:19:23 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[2ch]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[hatena]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=395</guid>
		<description><![CDATA[2ch Starは、2ちゃんねるのレスにはてなスターを付けるためのGreasemonkeyスクリプトです。version 0.2を書きましたので公開してみます：2ch Star v0.2 version 0.1とは以下の点が異なります。 通常の（専用ブラウザを介さない素の）2ちゃんねるに加えて、p2.2ch.netに対応しています。 URLにはPermalink for 2ちゃんねるを使わせてもらっています。 (bug fix) ページのタイトルが正しく取得できていない点を修正しました。 インストールする際は上記リンクからjsファイルをダウンロードし、&#8217;2chStar.user.js&#8217;という風にリネームしてからGreasemonkeyをインストール済みのFirefoxにD&#38;Dしてください。 注意点としては、 2ちゃんねる側のページからスターを削除できない（はてなのStartからは削除できる） 等があります（原因はよくわかりません。posが未定義ってなんだ？）。自己責任で使用してください。 追記 GitHubにも置いておきます。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2008/05/26/2ch-star-v02/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2008/05/26/2ch-star-v02/" />
	</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: aerial.st @ 2012-05-23 01:37:55 -->
