<?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; Ajax</title>
	<atom:link href="http://hiropo.co.uk/archives/category/ajax/feed" rel="self" type="application/rss+xml" />
	<link>http://hiropo.co.uk</link>
	<description>Web系エンジニアの適当なブログです。どうでも酔いものばかり作ってます。</description>
	<lastBuildDate>Sun, 25 Jul 2010 17:09:15 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>[mixiアプリ] マイミク一覧取得と、アプリ登録者を取得してみた</title>
		<link>http://hiropo.co.uk/archives/294</link>
		<comments>http://hiropo.co.uk/archives/294#comments</comments>
		<pubDate>Tue, 08 Sep 2009 15:45:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=294</guid>
		<description><![CDATA[北海道旅行から帰ってきたら何もやる気が起きなくなった僕です。 こんばんは。 北の大地があまりに広大すぎて心が空っぽになってしまいました。 さて、久しぶりにJavaScript書いてみました。 今回もmixiアプリのチュートリアルです。 前々回くらいで自分のユーザー情報を取得するスクリプトはつくってみました。 今回は、マイミク一覧とアプリ使用者をフィルタリングして、アプリを使ってるマイミクのみを取得するというテストをつくってみました。 PLAIN TEXT JavaScript: &#40;function&#40;&#41;&#123; &#160; &#160; &#160; /****************************************************************************************************** &#160; &#160; * &#160; &#160; *&#160; &#160;マイミク一覧を取得 &#160; &#160; *&#160; &#160;※このアプリに登録しているマイミクのみ &#160; &#160; */ &#160; &#160; /**------------------------------------- &#160; &#160; *&#160; &#160;initを定義 &#160; &#160; */ &#160; &#160; function init&#40;&#41;&#123; &#160; &#160; &#160; &#160; var ip = &#123;&#125;; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>北海道旅行から帰ってきたら何もやる気が起きなくなった僕です。<br />
こんばんは。</p>
<p>北の大地があまりに広大すぎて心が空っぽになってしまいました。</p>
<p>さて、久しぶりにJavaScript書いてみました。<br />
今回もmixiアプリのチュートリアルです。</p>
<p>前々回くらいで自分のユーザー情報を取得するスクリプトはつくってみました。<br />
今回は、マイミク一覧とアプリ使用者をフィルタリングして、アプリを使ってるマイミクのみを取得するというテストをつくってみました。</p>
<div class="igBar"><span id="ljavascript-4"><a href="#" onclick="javascript:showCodeTxt('javascript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-4">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/******************************************************************************************************</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;マイミク一覧を取得</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;※このアプリに登録しているマイミクのみ</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/**-------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;initを定義</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> ip = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ip<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">IdSpec</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">USER_ID</span> <span style="color: #66cc66;">&#93;</span> = opensocial.<span style="color: #006600;">IdSpec</span>.<span style="color: #006600;">PersonId</span>.<span style="color: #006600;">VIEWER</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ip<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">IdSpec</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">GROUP_ID</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #3366CC;">"FRIENDS"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> idSpec = opensocial.<span style="color: #006600;">newIdSpec</span><span style="color: #66cc66;">&#40;</span> ip <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> params = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//アプリ使用者だけを抽出</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; params<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">DataRequest</span>.<span style="color: #006600;">PeopleRequestFields</span>.<span style="color: #006600;">FILTER</span> <span style="color: #66cc66;">&#93;</span> = opensocial.<span style="color: #006600;">DataRequest</span>.<span style="color: #006600;">FilterType</span>.<span style="color: #006600;">HAS_APP</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//抽出したいパラメータをセット</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; params<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">DataRequest</span>.<span style="color: #006600;">PeopleRequestFields</span>.<span style="color: #006600;">PROFILE_DETAILS</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#91;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">PROFILE_URL</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">ADDRESSES</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">AGE</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">DATE_OF_BIRTH</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">GENDER</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">HAS_APP</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mixi.<span style="color: #006600;">PersonField</span>.<span style="color: #006600;">BLOOD_TYPE</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> rtn = <span style="color: #3366CC;">''</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> req = opensocial.<span style="color: #006600;">newDataRequest</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span> req.<span style="color: #006600;">newFetchPeopleRequest</span><span style="color: #66cc66;">&#40;</span> idSpec, params <span style="color: #66cc66;">&#41;</span>, <span style="color: #3366CC;">"friends"</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #006600;">send</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>data<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> friends = data.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">"friends"</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getData</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; friends.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> friend <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> id = friend.<span style="color: #006600;">getId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> nickname = friend.<span style="color: #006600;">getDisplayName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> thumbnailUrl = friend.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">THUMBNAIL_URL</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// プロフィール情報を使って処理</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rtn += <span style="color: #3366CC;">'&lt;div style=&quot;margin-bottom: 10px;&quot;&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rtn += <span style="color: #3366CC;">'[id]'</span>+ id +<span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rtn += <span style="color: #3366CC;">'[nickname]'</span>+ nickname + <span style="color: #3366CC;">'&lt;br /&gt;'</span> +<span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rtn += <span style="color: #3366CC;">'&lt;img src=&quot;'</span>+ thumbnailUrl +<span style="color: #3366CC;">'&quot; /&gt;'</span> +<span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rtn += <span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> element = $<span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'#dev_field'</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span> rtn <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;init</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; gadgets.<span style="color: #006600;">util</span>.<span style="color: #006600;">registerOnLoadHandler</span><span style="color: #66cc66;">&#40;</span> init <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>デフォルトで表示される件数は20件までなようです。<br />
さらに表示したい場合は、</p>
<div class="igBar"><span id="ljavascript-5"><a href="#" onclick="javascript:showCodeTxt('javascript-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-5">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">params<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">DataRequest</span>.<span style="color: #006600;">PeopleRequestFields</span>.<span style="color: #006600;">MAX</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #CC0000;color:#800000;">50</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
をつかって、件数を取得するようです。<br />
なんか、lengthやgetMyMixiLength()みたいなのないのかなぁ。</p>
<p>さらに、条件から一致した全体の数から、n件目から取得みたいなこともできる。</p>
<div class="igBar"><span id="ljavascript-6"><a href="#" onclick="javascript:showCodeTxt('javascript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">params<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">DataRequest</span>.<span style="color: #006600;">PeopleRequestFields</span>.<span style="color: #006600;">MAX</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #CC0000;color:#800000;">50</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">params<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">DataRequest</span>.<span style="color: #006600;">PeopleRequestFields</span>.<span style="color: #006600;">FIRST</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #CC0000;color:#800000;">30</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>上の例だと、「50件中、30件目から取得」みたいなことができる。<br />
公式のリファレンスまぁまぁわかりやすいんだけど、もっと細かいリファレンス欲しいなぁ。</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/294/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>めちゃめちゃ若いのに…。 &#8211; jQueryちゃん</title>
		<link>http://hiropo.co.uk/archives/292</link>
		<comments>http://hiropo.co.uk/archives/292#comments</comments>
		<pubDate>Tue, 01 Sep 2009 15:39:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=292</guid>
		<description><![CDATA[天才とはこのような少年のことをいうんだろうか。]]></description>
			<content:encoded><![CDATA[<p>天才とはこのような少年のことをいうんだろうか。</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/8mwKq7_JlS8&#038;hl=ja&#038;fs=1&#038;color1=0x2b405b&#038;color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8mwKq7_JlS8&#038;hl=ja&#038;fs=1&#038;color1=0x2b405b&#038;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/292/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[mixiアプリ] 2ちゃんねるまとめサイトのRSSリーダーをつくってみた</title>
		<link>http://hiropo.co.uk/archives/289</link>
		<comments>http://hiropo.co.uk/archives/289#comments</comments>
		<pubDate>Sun, 23 Aug 2009 16:18:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=289</guid>
		<description><![CDATA[いつも２ちゃんねるまとめサイトの巡回をするのだが、mixiアプリでRSSリーダーつくったら面白いかもと思い、1時間程度でmixiアプリをつくってみた。 google Ajax APIを使ったので、めちゃめちゃ簡単にできたお。 [mixi] 2ちゃんまとめRSSリーダー mixiアプリおもしれいお（＾ｑ＾）]]></description>
			<content:encoded><![CDATA[<p>いつも２ちゃんねるまとめサイトの巡回をするのだが、mixiアプリでRSSリーダーつくったら面白いかもと思い、1時間程度でmixiアプリをつくってみた。<br />
google Ajax APIを使ったので、めちゃめちゃ簡単にできたお。</p>
<p><a href="http://platform001.mixi.jp/run_appli.pl?id=6869" target="_blank"><img src="http://hiropo.co.uk/wp-content/uploads/2009/08/e5908de7a7b0e69caae8a8ade5ae9a-1-300x162.jpg" alt="" title="e5908de7a7b0e69caae8a8ade5ae9a-1" width="300" height="162" class="aligncenter size-medium wp-image-290" /></a></p>
<p><a href="http://platform001.mixi.jp/run_appli.pl?id=6869" target="_blank">[mixi] 2ちゃんまとめRSSリーダー</a></p>
<p>mixiアプリおもしれいお（＾ｑ＾）</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/289/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[mixiアプリ] ユーザー情報を取得してみた。</title>
		<link>http://hiropo.co.uk/archives/284</link>
		<comments>http://hiropo.co.uk/archives/284#comments</comments>
		<pubDate>Sun, 23 Aug 2009 08:52:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=284</guid>
		<description><![CDATA[mixiでソーシャルアプリケーションアワードという開発者のためのイベントが行われているようです。 よくわかんないけど、mixiの情報を使って、アプリケーションが作れるmixiアプリを作って応募しよう！というものであるようです。 mixiアプリ開発のためのサイトまでできている。 で、このmixiアプリ、APIを公開しているので、APIを使ったAjax開発経験者なら誰でもすぐに開発ができるようです。mixiAPIは情報がリアルなユーザー情報だけに何だか面白そう！ ってなことで、mixiアプリに入門してみました。 mixiアプリを開発するには公開環境を登録するみたいなことをしなきゃならないようです。 （ここでは割愛します。） まずは、mixiアプリの基盤ともいえるガジェットXMLを作ります。 PLAIN TEXT XML: &#60;?xml version="1.0" encoding="UTF-8"?&#62; &#160; &#60;module&#62; &#160; &#60;modulePrefs title="mixiアプリのてすとやねん"&#62; &#160; &#160; &#60;require feature="opensocial-0.8" /&#62; &#160; &#60;/modulePrefs&#62; &#160; &#60;content type="html"&#62;&#60;![CDATA[ &#160; &#160; &#60;!--&#124;&#124;&#124; head &#124;&#124;&#124;--&#62; &#160; &#160; &#60;!--&#124;&#124;&#124; StyleSheet &#124;&#124;&#124;--&#62; &#160; &#60;link rel=&#34;stylesheet&#34; href=&#34;http://funnythingz.com/mixi/test/css/style.css&#34; type=&#34;text/css&#34; media=&#34;screen,all&#34; /&#62; &#160; &#160; &#60;!--&#124;&#124; JavaScript FrameWork &#124;&#124;--&#62; &#160; &#60;script type=&#34;text/javascript&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>mixiで<a href="http://developer.mixi.co.jp/award" target="_blank">ソーシャルアプリケーションアワード</a>という開発者のためのイベントが行われているようです。<br />
よくわかんないけど、mixiの情報を使って、アプリケーションが作れるmixiアプリを作って応募しよう！というものであるようです。</p>
<p><a href="http://developer.mixi.co.jp/" target="_blank">mixiアプリ開発のためのサイト</a>までできている。<br />
で、このmixiアプリ、APIを公開しているので、APIを使ったAjax開発経験者なら誰でもすぐに開発ができるようです。mixiAPIは情報がリアルなユーザー情報だけに何だか面白そう！</p>
<p>ってなことで、mixiアプリに入門してみました。<br />
mixiアプリを開発するには公開環境を登録するみたいなことをしなきゃならないようです。<br />
（ここでは割愛します。）</p>
<p>まずは、mixiアプリの基盤ともいえるガジェットXMLを作ります。</p>
<div class="igBar"><span id="lxml-10"><a href="#" onclick="javascript:showCodeTxt('xml-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-10">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"UTF-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;module<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;modulePrefs</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"mixiアプリのてすとやねん"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;require</span> <span style="color: #000066;">feature</span>=<span style="color: #ff0000;">"opensocial-0.8"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/modulePrefs<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"html"</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!--||| head |||--&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!--||| StyleSheet |||--&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;link rel=&quot;stylesheet&quot; href=&quot;http://funnythingz.com/mixi/test/css/style.css&quot; type=&quot;text/css&quot; media=&quot;screen,all&quot; /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!--|| JavaScript FrameWork ||--&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;script type=&quot;text/javascript&quot;&gt;google.load(&quot;jquery&quot;, &quot;1.3.2&quot;);&lt;/script&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!--|| OriginalScript ||--&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;script type=&quot;text/javascript&quot; src=&quot;http://funnythingz.com/mixi/test/js/test.js&quot;&gt;&lt;/script&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!--||| /head |||--&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!--||| body |||--&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;div id=&quot;dev_field&quot;&gt;&lt;/div&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!--||| /body |||--&gt;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; ]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/module<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>HTMLの書き方わかる人なら、普通のHTMLを書くように、書けば特に問題なし。<br />
外部JSやCSSの読み込みもできる。</p>
<p>ちなみに、外部JSや外部CSSのパスは絶対パスで書くこと。<br />
ファイルは自分で用意したサーバに置く。</p>
<p>次に、外部CSSと外部JSを用意する。<br />
ガジェットXMLのみですべて済ませたい人はそれで特に問題なし。<br />
大規模な開発を行うならやはりファイルは分けておいたほうが後々わかり易い。</p>
<p>CSSはフィールド背景に色をつけてみた。<br />
これで出力される場所がわかる。</p>
<div class="igBar"><span id="lcss-11"><a href="#" onclick="javascript:showCodeTxt('css-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-11">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">@charset &quot;utf-8&quot;;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*&nbsp; mixiアプリ用CSS</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#dev_field <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000000; font-weight: bold;">background</span>: #ddd;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>次にJSファイルの用意。コア部分のプログラミングになるので、JSは外部ファイルにすることを推奨。<br />
今回はmixiアプリにアクセスしたユーザー情報を取得してみる。</p>
<div class="igBar"><span id="ljavascript-12"><a href="#" onclick="javascript:showCodeTxt('javascript-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-12">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">/******************************************************************************************************</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; *</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; *&nbsp; mixiアプリAPIを使ってユーザー情報を取得してみる</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">/**-------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; *&nbsp; initを定義</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/**-------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; 取得したい情報パラメータをセット</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> params = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; params<span style="color: #66cc66;">&#91;</span> opensocial.<span style="color: #006600;">DataRequest</span>.<span style="color: #006600;">PeopleRequestFields</span>.<span style="color: #006600;">PROFILE_DETAILS</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#91;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">PROFILE_URL</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">ADDRESSES</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">AGE</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">DATE_OF_BIRTH</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">GENDER</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">HAS_APP</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; mixi.<span style="color: #006600;">PersonField</span>.<span style="color: #006600;">BLOOD_TYPE</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/**-------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; リクエストを生成</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> req = opensocial.<span style="color: #006600;">newDataRequest</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; req.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span> req.<span style="color: #006600;">newFetchPersonRequest</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">IdSpec</span>.<span style="color: #006600;">PersonId</span>.<span style="color: #006600;">VIEWER</span>, params <span style="color: #66cc66;">&#41;</span>, <span style="color: #3366CC;">'viewer'</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; req.<span style="color: #006600;">send</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> data <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/**--------------------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; *&nbsp; var プロフィール情報を取得</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/**-------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; *&nbsp; エレメントセット</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> element = $<span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'#dev_field'</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/**-------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; *&nbsp; アプリを使用しているユーザー情報をセット</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> viewer = data.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'viewer'</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getData</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//ニックネーム</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_name = viewer.<span style="color: #006600;">getDisplayName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//ID</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_id = viewer.<span style="color: #006600;">getId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//サムネイル画像</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_thumbnail = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">THUMBNAIL_URL</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//プロフィールURL</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_url = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">PROFILE_URL</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//出身地</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_pref = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">ADDRESSES</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span>opensocial.<span style="color: #006600;">Address</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">UNSTRUCTURED_ADDRESS</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//年齢</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_age = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">AGE</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//誕生日</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_birth = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">DATE_OF_BIRTH</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//性別</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_gender = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">GENDER</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getKey</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//血液型</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> user_blood_type = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> mixi.<span style="color: #006600;">PersonField</span>.<span style="color: #006600;">BLOOD_TYPE</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//このアプリをインストールしているか（戻り値:bool）</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> hasApp = viewer.<span style="color: #006600;">getField</span><span style="color: #66cc66;">&#40;</span> opensocial.<span style="color: #006600;">Person</span>.<span style="color: #006600;">Field</span>.<span style="color: #006600;">HAS_APP</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/**--------------------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; *&nbsp; プロフィール情報を使った処理</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//HTMLテンプレート</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> template = <span style="color: #3366CC;">''</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_name] '</span>+ user_name +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_id] '</span>+ user_id +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_thumbnail]&lt;br /&gt;&lt;img src=&quot;'</span>+ user_thumbnail +<span style="color: #3366CC;">'&quot; alt=&quot;'</span>+ user_name +<span style="color: #3366CC;">'&quot; /&gt;&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_url] &lt;a href=&quot;'</span>+ user_url +<span style="color: #3366CC;">'&quot; target=&quot;_blank&quot;&gt;'</span>+ user_url +<span style="color: #3366CC;">'&lt;/a&gt;&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_pref] '</span>+ user_pref +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_age] '</span>+ user_age +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_birth] '</span>+ user_birth +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_gender] '</span>+ user_gender +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[user_blood_type] '</span>+ user_blood_type +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; template += <span style="color: #3366CC;">'&lt;div&gt;[hasApp] '</span>+ hasApp +<span style="color: #3366CC;">'&lt;/div&gt;'</span> + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//出力</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; element.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span> template <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">//init</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; gadgets.<span style="color: #006600;">util</span>.<span style="color: #006600;">registerOnLoadHandler</span><span style="color: #66cc66;">&#40;</span> init <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>これで、ユーザー情報の取得ができる。<br />
あとは煮るなり焼くなり好きに調理してアプリを開発すればおｋ。</p>
<p>つくったmixiアプリの実行方法だが、<a href="http://platform001.mixi.jp/view_community.pl?id=3217244" target="_blank">mixiアプリ オープンβ</a>というコミュニティに参加しなくてはならない。<br />
まだβ版だから仕方ないのか？いまいちこのめんどくさい作業は省いてもらいたいなぁ。</p>
<p>他に指定IDのユーザー情報やマイミク一覧の情報なども取得できるよう。<br />
他APIと組み合わせてアプリを開発することも可能なので、けっこう盛り上がる予感がしますね。</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/284/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aptana1.5 インストールと日本語化</title>
		<link>http://hiropo.co.uk/archives/181</link>
		<comments>http://hiropo.co.uk/archives/181#comments</comments>
		<pubDate>Wed, 29 Jul 2009 16:44:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=181</guid>
		<description><![CDATA[こんぬつわ。 JavaとかRubyとかやろうかなと思いつつも、結局気づいたらJavaScriptしか書いてない僕です。 JavaScripterな人たちにとって有名か有名じゃないかわかりませんが、Adobe AIRでAjaxやらMXML+ActionScriptを使ってデスクトップアプリが簡単（？）に作れるオーサリングツール、Aptana。AIRアプリをつくるときにものすごく重宝しています。 Eclipseを元に開発されたらしいので、（Eclipseのプラグインとしてのインストールも可）Java開発ならEclipse、JavaScriptならAptanaというイメージで使っています。 元々英語なので、インストール後に日本語化しなくてはいけないので、簡単に手順を。 [1] Aptana公式サイトからAptana本体をダウンロード [2] ダウンロード完了後、インストール。 [3] 英語のまま使いたかったらこのままでも使えますが、日本語化するため、eclipseの日本語化プラグインを使います。(aptanaはeclipseをベースに作られているため使用可能)。 こちらからPleiade（安定版）をダウンロードします。 [4] Pleiadesを解凍し、featuresフォルダとpluginsフォルダをAptanaがインストールされているフォルダに移動し、コピーする。 [5] AptanaStudio.iniに下記を追記する。 -javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar Aptanaを起動し、日本語化されていればインストール成功 環境が整ったら、AIRを開発するための環境を整えたりすればおｋ（＾ｑ＾）]]></description>
			<content:encoded><![CDATA[<p>こんぬつわ。<br />
JavaとかRubyとかやろうかなと思いつつも、結局気づいたらJavaScriptしか書いてない僕です。</p>
<p>JavaScripterな人たちにとって有名か有名じゃないかわかりませんが、Adobe AIRでAjaxやらMXML+ActionScriptを使ってデスクトップアプリが簡単（？）に作れるオーサリングツール、Aptana。AIRアプリをつくるときにものすごく重宝しています。<br />
Eclipseを元に開発されたらしいので、（Eclipseのプラグインとしてのインストールも可）Java開発ならEclipse、JavaScriptならAptanaというイメージで使っています。</p>
<p>元々英語なので、インストール後に日本語化しなくてはいけないので、簡単に手順を。</p>
<blockquote><p>
[1]<br />
Aptana公式サイトから<a href="http://www.aptana.com/" target="_blank">Aptana本体をダウンロード</a></p>
<p>[2]<br />
ダウンロード完了後、インストール。</p>
<p>[3]<br />
英語のまま使いたかったらこのままでも使えますが、日本語化するため、eclipseの日本語化プラグインを使います。(aptanaはeclipseをベースに作られているため使用可能)。</p>
<p>こちらから<a href="http://mergedoc.sourceforge.jp/index.html#/pleiades.html" target="_blank">Pleiade（安定版）をダウンロード</a>します。</p>
<p>[4]<br />
Pleiadesを解凍し、featuresフォルダとpluginsフォルダをAptanaがインストールされているフォルダに移動し、コピーする。</p>
<p>[5]<br />
AptanaStudio.iniに下記を追記する。<br />
-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar</p>
<p>Aptanaを起動し、日本語化されていればインストール成功
</p></blockquote>
<p>環境が整ったら、AIRを開発するための環境を整えたりすればおｋ（＾ｑ＾）</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/181/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>urlエンコードと文字コード</title>
		<link>http://hiropo.co.uk/archives/176</link>
		<comments>http://hiropo.co.uk/archives/176#comments</comments>
		<pubDate>Tue, 14 Jul 2009 15:19:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=176</guid>
		<description><![CDATA[最近、外部のAPIを使うようになってから、文字コードに振り回される機会が多いのでちょっとメモっとく。 utf-8でエンコードされてるものを使う場合、htmlがShift_JISやeuc-jpの場合、utf-8でエンコードされたAPIを読み込む場合はsharsetに読み込み元の文字コードを記述する。 PLAIN TEXT HTML: &#60;script type="text/javascript" src="xxxxxxx.js" charset="utf-8" /&#62;&#60;/script&#62; Firefoxやsafariといったブラウザは自動で内部変換してくれるのだが、IEは内部で変換してくれないのでこういった処置が必要になる。 もろもろめんどくさいが、指定しておいたほうが確実ですね。]]></description>
			<content:encoded><![CDATA[<p>最近、外部のAPIを使うようになってから、文字コードに振り回される機会が多いのでちょっとメモっとく。</p>
<p>utf-8でエンコードされてるものを使う場合、htmlがShift_JISやeuc-jpの場合、utf-8でエンコードされたAPIを読み込む場合はsharsetに読み込み元の文字コードを記述する。</p>
<div class="igBar"><span id="lhtml-14"><a href="#" onclick="javascript:showCodeTxt('html-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-14">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"xxxxxxx.js"</span> <span style="color: #000066;">charset</span>=<span style="color: #ff0000;">"utf-8"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Firefoxやsafariといったブラウザは自動で内部変換してくれるのだが、IEは内部で変換してくれないのでこういった処置が必要になる。<br />
もろもろめんどくさいが、指定しておいたほうが確実ですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/176/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FlashPlayerの有無を判別する構文 &#8211; JavaScript</title>
		<link>http://hiropo.co.uk/archives/153</link>
		<comments>http://hiropo.co.uk/archives/153#comments</comments>
		<pubDate>Wed, 03 Jun 2009 02:44:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=153</guid>
		<description><![CDATA[swfobject.js(ver_1.5)を使った場合のFlashPlayerの有無の判別。 いつもスクラッチするので、めんどくさいと思いメモ。 PLAIN TEXT JavaScript: /* *&#160; &#160;swfobject.js(ver_1.5)を使った場合 */ var so = new SWFObject&#40;'sample.swf', 'top', '100%', '394', '8', '#f2ebda'&#41;; if&#40;so.installedVer.major&#38;gt;= 8&#41;&#123; /*------------------------------------------------- *&#160; &#160;FlashPlayer8以上がインストールされている場合、 *&#160; &#160;トップページにFlashを表示する。 */ &#160; &#125;else&#123; /*------------------------------------------------- *&#160; &#160;FlashPlayer8以上がインストールされていない場合、 *&#160; &#160;Adpbe公式のFlashPlayerのインストール画面へリンクする *&#160; &#160;画面を表示する。 */ &#160; &#125;]]></description>
			<content:encoded><![CDATA[<p>swfobject.js(ver_1.5)を使った場合のFlashPlayerの有無の判別。<br />
いつもスクラッチするので、めんどくさいと思いメモ。</p>
<div class="igBar"><span id="ljavascript-16"><a href="#" onclick="javascript:showCodeTxt('javascript-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-16">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/*</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;swfobject.js(ver_1.5)を使った場合</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> so = <span style="color: #003366; font-weight: bold;">new</span> SWFObject<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'sample.swf'</span>, <span style="color: #3366CC;">'top'</span>, <span style="color: #3366CC;">'100%'</span>, <span style="color: #3366CC;">'394'</span>, <span style="color: #3366CC;">'8'</span>, <span style="color: #3366CC;">'#f2ebda'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>so.<span style="color: #006600;">installedVer</span>.<span style="color: #006600;">major</span>&amp;gt;= <span style="color: #CC0000;color:#800000;">8</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/*-------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;FlashPlayer8以上がインストールされている場合、</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;トップページにFlashを表示する。</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/*-------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;FlashPlayer8以上がインストールされていない場合、</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;Adpbe公式のFlashPlayerのインストール画面へリンクする</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;画面を表示する。</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/153/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS判別JS</title>
		<link>http://hiropo.co.uk/archives/147</link>
		<comments>http://hiropo.co.uk/archives/147#comments</comments>
		<pubDate>Wed, 20 May 2009 01:29:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=147</guid>
		<description><![CDATA[何か使えるかもしれないので、OS判別スクリプトをメモ PLAIN TEXT JavaScript: var getOS = function&#40;&#41; &#123; &#160; &#160;var agent = navigator.userAgent.toLowerCase&#40;&#41; ; &#160; &#160;var Win_OS = agent.indexOf&#40;"win"&#41; != -1 ; &#160; &#160;var Mac_OS = agent.indexOf&#40;"mac"&#41; != -1 ; &#160; &#160;var Linux_OS = agent.indexOf&#40;"linux"&#41; != -1 ; &#160; &#160;var Other_OS = agent.indexOf&#40;"win"&#41; == -1 &#38;&#38; &#160; &#160;agent.indexOf&#40;"mac"&#41; == -1 &#38;&#38; &#160; &#160;agent.indexOf&#40;"linux"&#41; == [...]]]></description>
			<content:encoded><![CDATA[<p>何か使えるかもしれないので、OS判別スクリプトをメモ</p>
<div class="igBar"><span id="ljavascript-18"><a href="#" onclick="javascript:showCodeTxt('javascript-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-18">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> getOS = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> agent = navigator.<span style="color: #006600;">userAgent</span>.<span style="color: #006600;">toLowerCase</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> Win_OS = agent.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"win"</span><span style="color: #66cc66;">&#41;</span> != -<span style="color: #CC0000;color:#800000;">1</span> ;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> Mac_OS = agent.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"mac"</span><span style="color: #66cc66;">&#41;</span> != -<span style="color: #CC0000;color:#800000;">1</span> ;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> Linux_OS = agent.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"linux"</span><span style="color: #66cc66;">&#41;</span> != -<span style="color: #CC0000;color:#800000;">1</span> ;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> Other_OS = agent.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"win"</span><span style="color: #66cc66;">&#41;</span> == -<span style="color: #CC0000;color:#800000;">1</span> &amp;&amp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;agent.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"mac"</span><span style="color: #66cc66;">&#41;</span> == -<span style="color: #CC0000;color:#800000;">1</span> &amp;&amp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;agent.<span style="color: #006600;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"linux"</span><span style="color: #66cc66;">&#41;</span> == -<span style="color: #CC0000;color:#800000;">1</span> ;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Win_OS<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>os = <span style="color: #3366CC;">"Windows"</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Mac_OS<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>os = <span style="color: #3366CC;">"MacOS"</span>;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Linux_OS<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>os = <span style="color: #3366CC;">"Linux"</span>;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Other_OS<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>os = <span style="color: #3366CC;">"不明"</span>;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span> os;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/147/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>フォントサイズをうにゅうにゅさせてみた。</title>
		<link>http://hiropo.co.uk/archives/137</link>
		<comments>http://hiropo.co.uk/archives/137#comments</comments>
		<pubDate>Wed, 04 Mar 2009 16:11:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=137</guid>
		<description><![CDATA[フォントサイズをうにゅうにゅさせるJSを実装してみた。 動作デモはこちら なんてこたぁないJSです。jQuery使ったら30分で実装できた。 jQuery、凄すぎる！ ついでに、ブラウザ閉じても最後に設定したフォントサイズを維持してくれるように クッキーの制御入れてます。 ソースコードのダウンロードはこちら]]></description>
			<content:encoded><![CDATA[<p>フォントサイズをうにゅうにゅさせるJSを実装してみた。</p>
<p><a href="http://funnythingz.com/dev/onono/ " target="_blank">動作デモはこちら</a></p>
<p>なんてこたぁないJSです。jQuery使ったら30分で実装できた。<br />
jQuery、凄すぎる！</p>
<p>ついでに、ブラウザ閉じても最後に設定したフォントサイズを維持してくれるように<br />
クッキーの制御入れてます。</p>
<p><a href="http://funnythingz.com/dev/onono/onono.lzh">ソースコードのダウンロードはこちら</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/137/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScriptでvar_dump()が使えるライブラリ &#8211; funny.js</title>
		<link>http://hiropo.co.uk/archives/46</link>
		<comments>http://hiropo.co.uk/archives/46#comments</comments>
		<pubDate>Fri, 12 Sep 2008 09:53:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/archives/46</guid>
		<description><![CDATA[PHPのvar_dump() が、JavaScriptで var_dump()できちゃうライブラリです。 var_dump() ver_0.5 ダウンロード 使い方は以下の通りです。 funny.jsを読み込んで、PHPと同じ感覚で、var_dump() しちゃってください。 シンタックスエラー以外は何かしら返ってくると思います。 PLAIN TEXT HTML: &#60;script src="funny.js" type="text/javascript"&#62;&#60;/script&#62; &#60;script type="text/javascript"&#62; &#160; var a = 123; funny.var_dump( a ); &#160; &#60;/script&#62;]]></description>
			<content:encoded><![CDATA[<p>PHPのvar_dump() が、JavaScriptで var_dump()できちゃうライブラリです。</p>
<p><a href="http://www.funnythingz.com/common/file/funny_0.5.lzh">var_dump() ver_0.5 ダウンロード</a></p>
<p>使い方は以下の通りです。<br />
funny.jsを読み込んで、PHPと同じ感覚で、var_dump() しちゃってください。<br />
シンタックスエラー以外は何かしら返ってくると思います。</p>
<div class="igBar"><span id="lhtml-20"><a href="#" onclick="javascript:showCodeTxt('html-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-20">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"funny.js"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">var a = 123;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">funny.var_dump( a );</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/46/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
