<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>石間謙 勝手ブログ Ver.2.5 &#187; jquery</title>
	<atom:link href="http://jbar.jp/ishima/tag/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://jbar.jp/ishima</link>
	<description>IT、iPhone、NOKIA、バー、日本酒、柏、冷麺、釣り、星、フードニングネタを書き綴るサイト</description>
	<lastBuildDate>Wed, 16 May 2012 02:13:44 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/tag/jquery/feed" />
		<item>
		<title>JQueryでドラッグ＆ドロップで複数のファイルをアップロード</title>
		<link>http://jbar.jp/ishima/it/jquery_multifile_drag_drop.html</link>
		<comments>http://jbar.jp/ishima/it/jquery_multifile_drag_drop.html#comments</comments>
		<pubDate>Fri, 04 Jun 2010 06:49:35 +0000</pubDate>
		<dc:creator>石間</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://jbar.jp/ishima/?p=852</guid>
		<description><![CDATA[TineMCEで有名な作者が今度はPluploadというJQueryというプラグインを開発したようだ。 デモを試したい方はこちら。 これで今までできなかった「複数のファイルをドラッグ＆ドロップでアップロード」ということが [...]]]></description>
			<content:encoded><![CDATA[<p>TineMCEで有名な作者が今度は<a href="http://www.plupload.com/">Plupload</a>というJQueryというプラグインを開発したようだ。</p>
<p>デモを試したい方は<a href="http://www.plupload.com/example_queuewidget.php">こちら</a>。</p>
<p>これで今までできなかった「複数のファイルをドラッグ＆ドロップでアップロード」ということができるようになる。</p>
<p>（普通はブラウザに画像をドラッグ＆ドロップすると画像を開くだけです）</p>
<p>今まではファイルを1つずつしか選択できなかった事を考えると、これはユーザにとって非常に便利な機能だ。</p>
<hr/>
<strong><span style="color: #333399;">石間を賢くしたモノ　001</span></strong></p>
<p>JQueryのtriggerは他のイベントを呼び出せて便利／JQueryのプラグインjquery.panzoom.jsはチラシの見せ方には面白い／JQueryのPuploadで複数ファイルドラッグ＆ドロップがすごい／XnView使ってみたら便利過ぎ／TextSSで一気に置換でとても便利</p>
<p><span style="color: #99cc00;"><strong><span style="color: #333399;">石間のボソッと</span></strong></span></p>
<p>朝から暑い-&gt;今日はJQueryの知識吸収ばかりだ。-&gt;AndroidSDK&amp;Eclipseでアプリ長者を目指せるのか？-&gt;Paypal資料無さ過ぎ。-&gt;今日は渋谷でビジネス交流会だ。</p>
<img src="http://jbar.jp/ishima/?ak_action=api_record_view&id=852&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jbar.jp/ishima/it/jquery_multifile_drag_drop.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/it/jquery_multifile_drag_drop.html" />
	</item>
		<item>
		<title>市役所サイトを閲覧中</title>
		<link>http://jbar.jp/ishima/it/20100412_thinking.html</link>
		<comments>http://jbar.jp/ishima/it/20100412_thinking.html#comments</comments>
		<pubDate>Mon, 12 Apr 2010 14:45:27 +0000</pubDate>
		<dc:creator>石間</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://jbar.jp/ishima/?p=737</guid>
		<description><![CDATA[ちょっと訳あっていろいろな市役所、区役所のサイトを見て回っている。 すると結構ZoomSightという日立のサービスを利用しているサイトを見かける。いわゆる視聴覚障害者に対してウェブサイトのアクセシビリティ向上のためのサ [...]]]></description>
			<content:encoded><![CDATA[<p>ちょっと訳あっていろいろな市役所、区役所のサイトを見て回っている。</p>
<p>すると結構<a href="http://www.gp.hitachi.co.jp/eigyo/product/zoomsight/" target="_blank">ZoomSight</a>という日立のサービスを利用しているサイトを見かける。いわゆる視聴覚障害者に対してウェブサイトのアクセシビリティ向上のためのサービスだ。「表示サイズ変更機能」「画面カラー変更機能」「音声読み上げ機能」「ふりがな（るび）機能」などがある。</p>
<p>１ドメインで120万円近くする価格のようだ。値段の付け方がすごいですね。（＾＾；ある意味さすが大手。私にはできない値段設定です。</p>
<p>次のサービス開発のネタには是非「アクセシビリティ」を活かしたいが、JQueryで実現できるのだろうか。今、頭の中で考えていることを実現するにはHTML５のcanvasタグなどの勉強も必要そうだ。あとは今日biglobeのサイトでみかけた「あの」サービスも参考にしたら面白いものが出来上がるかもしれない・・・。</p>
<p>あ、でもその前に「○○向けガジェット」も作らなければ・・・。うーん、頭の容量が追い付かない。</p>
<p>話は逸れますが、JQueryもMicrosoftが公に力を入れてサポートすることになったようなので、ますます重要性が高まりそうですね。</p>
<img src="http://jbar.jp/ishima/?ak_action=api_record_view&id=737&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jbar.jp/ishima/it/20100412_thinking.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/it/20100412_thinking.html" />
	</item>
		<item>
		<title>JQueryとgetJSONで悩む</title>
		<link>http://jbar.jp/ishima/it/jquery_getjson.html</link>
		<comments>http://jbar.jp/ishima/it/jquery_getjson.html#comments</comments>
		<pubDate>Sat, 06 Mar 2010 00:43:48 +0000</pubDate>
		<dc:creator>石間</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[getjson]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://jbar.jp/ishima/?p=675</guid>
		<description><![CDATA[最近JQueryにはまっている。 JavaScriptは昔から嫌いでほとんど使わなかったが、このJQueryを使いだしてからは積極的に使うようになった。面倒くさいと思っていたJavaScriptをこれだけ使うようになった [...]]]></description>
			<content:encoded><![CDATA[<p>最近JQueryにはまっている。</p>
<p>JavaScriptは昔から嫌いでほとんど使わなかったが、このJQueryを使いだしてからは積極的に使うようになった。面倒くさいと思っていたJavaScriptをこれだけ使うようになったのは、JQueryのおかげとしかいようがない。</p>
<p>ところがここしばらくハマっている問題が・・・。</p>
<p>作っているブログパーツを外部サーバに貼り付けたときの問題だ。もちろん、ブログパーツなので外部に貼り付けられなければ意味がない。同じサーバ内に貼り付けて実行するのには何の問題もないという状態になっている。</p>
<p>これはBサーバに貼り付けたブログパーツがAサーバのJavaScriptを実行しているために起きている。AサーバのJavaScriptであるタイミングで$.postをし、DBに接続したいのだがうまくいかない。これはいわゆるクロスドメインによるものだ。JavaScriptは別サーバのものはセキュリティ上基本的には呼び出せない。</p>
<p>つまりAサーバ上で実行している分にはなんの問題もないが、Bサーバに貼り付けると動かない状態になってしまう。</p>
<p>しかし、これでは意味がない。<br /> 解決策はあると信じ、調べていくとJQueryの.getJSONならそれができることがわかった。 <br /> ただ、このgetJSONで呼び出すスクリプト上で今度はDB接続とJSONのechoが同時にできない・・・。（泣）<br /> まだ解決への道程は長そうだ。</p>
<p>↑余計なecho文が入っていたのが原因という単純なミスでした。</p>
<img src="http://jbar.jp/ishima/?ak_action=api_record_view&id=675&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jbar.jp/ishima/it/jquery_getjson.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/it/jquery_getjson.html" />
	</item>
		<item>
		<title>AjaxなPOSTのメール送信で悩む</title>
		<link>http://jbar.jp/ishima/it/ajax_mail_post_textarea.html</link>
		<comments>http://jbar.jp/ishima/it/ajax_mail_post_textarea.html#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:52:03 +0000</pubDate>
		<dc:creator>石間</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[textarea]]></category>

		<guid isPermaLink="false">http://jbar.jp/ishima/?p=664</guid>
		<description><![CDATA[問い合わせフォームなどをJQuery+ajaxで送信させるときに悩んだことをメモった。 FORMタグのtextareaの値を取得するときにval()で取得してajaxでPOSTしようとするとうまくいかない。これはtext [...]]]></description>
			<content:encoded><![CDATA[<p>問い合わせフォームなどをJQuery+ajaxで送信させるときに悩んだことをメモった。</p>
<p>FORMタグのtextareaの値を取得するときにval()で取得してajaxでPOSTしようとするとうまくいかない。これはtextareaで改行コードが入るためだ。</p>
<p>JQueryを使わないで通常の方法でPOSTするなら下記のようにtextareaに「wrap=&#8221;soft&#8221;」を付ければtextarea内のデータは改行コードを省いてくれるが、今回はJQueryでフォーム内の値を取得しているので下記の方法は使えない。</p>
<p>&lt;textarea wrap=&#8221;soft&#8221;&gt;ほげほげ&lt;/textarea&gt;</p>
<p>というわけで改行コードを省く処理をJavaScriptで行う必要がある。探していたら見つけた。</p>
<p><a href="http://www.kanaya440.com/contents/tips/javascript/002.html">http://www.kanaya440.com/contents/tips/javascript/002.html</a></p>
<pre class="brush: jscript; title: ; notranslate">function DeleteLineFeed(myLen) {
    var newLen = '';
    for(var i=0; i&lt;myLen.length; i++){
        text = escape(myLen.substring(i, i+1));
        if(text != &quot;%0D&quot; &amp;&amp; text != &quot;%0A&quot;){
            newLen += myLen.substring(i, i+1);
        }
    }
    return(newLen);
}</pre>
<p>これでtextareaの値の改行コードを省いてPOSTすればよい。<br />
解決までに結構時間かかった・・・。</p>
<img src="http://jbar.jp/ishima/?ak_action=api_record_view&id=664&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jbar.jp/ishima/it/ajax_mail_post_textarea.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/it/ajax_mail_post_textarea.html" />
	</item>
		<item>
		<title>ブログパーツを作ってみた２</title>
		<link>http://jbar.jp/ishima/it/blog_parts_20100111.html</link>
		<comments>http://jbar.jp/ishima/it/blog_parts_20100111.html#comments</comments>
		<pubDate>Sun, 10 Jan 2010 17:46:44 +0000</pubDate>
		<dc:creator>石間</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ブログパーツ]]></category>

		<guid isPermaLink="false">http://jbar.jp/ishima/?p=576</guid>
		<description><![CDATA[たまたまSnoopy.Classに触れる機会があったところから始まって、htmlSQL-&#62;ブログパーツ-&#62;JQuery-&#62;Ajaxと流れ、ようやくブログパーツ全般の作り方を習得した。 ブログパーツ上でユ [...]]]></description>
			<content:encoded><![CDATA[<p>たまたま<a href="http://sourceforge.net/projects/snoopy/" mce_href="http://sourceforge.net/projects/snoopy/">Snoopy.Class</a>に触れる機会があったところから始まって、<a href="http://www.jonasjohn.de/lab/htmlsql.htm" mce_href="http://www.jonasjohn.de/lab/htmlsql.htm">htmlSQL</a>-&gt;ブログパーツ-&gt;JQuery-&gt;Ajaxと流れ、ようやくブログパーツ全般の作り方を習得した。<br />
ブログパーツ上でユーザが起こしたアクションを取得して何かを実行させるためには、どうしてもJQueryが避けて通れないが、この3連休を使ってトライしてみたところ、今日（というかすでに昨日から10時間ぶっ続けに近い・・・）、ようやく基本は理解できた（と思う）。でもやっぱりJavaScriptは自分には面倒くさく見えてしまうのだが、ここまでできるのならどうにか忘れないようにしたい。正直ここまでまっとうなブログパーツになるとは思わなかった。</p>
<p>因みにここまでできるとDBとの連動も楽にできるので、意外と活用方法があると思う。DBと連携する必要がない（集計やデータの更新、追加が必要ない）なら前回の記事のようにhtmlSQLとCSVファイルだけでも同じようなことが実現できる。<br />
下記はMySQLのデータベースと連動させて簡単なアンケート・投票ブログパーツを作ってみたものだが、「答える」を押すとJQueryでPHPのスクリプトを呼び出し、DBから選択肢を集計しグラフ表示するようにしてみたものだ。</p>
<p>ただ、グラフも味気ない表示だとつまらないので、進捗バーのように表示されるバーを実現した。これも<a href="http://t.wits.sg/misc/jQueryProgressBar/demo.php" mce_href="http://t.wits.sg/misc/jQueryProgressBar/demo.php">JQuery.ProgressBar</a>で実現している。うーん、JQueryは本当に素晴らしい。</p>
<p>携帯ブラウザがJavaScriptを扱えないので、このまま携帯サイトに流用できないところが惜しいが、PCサイトでも簡単に不特定のユーザからアンケートなどを収集するのに使えるので良いと思う。こういうシステム自体を有料で<a href="http://f32.aaa.livedoor.jp/~azusa/?t=topic&amp;p=webpolls" mce_href="http://f32.aaa.livedoor.jp/~azusa/?t=topic&amp;p=webpolls">提供しているところ</a>もあるようだ。うちでもやってみようか。短時間での重複クリックなどを防止する機能を付ければさらに良いかもしれない。</p>
<p>携帯に関して言えばフロントエンドの部分をFLASHにすればPCと同様の動きにすることも可能だろうが、この前ハマったみたいにFLASHLITE1.xでやるとなると手こずりそうだ。とりあえずは普通のHTMLで作るシンプルなものしか携帯ではできないかもしれない。</p>
<div class="mceTemp">
<dl id="attachment_577" class="wp-caption alignleft" style="width: 217px">
<dt class="wp-caption-dt"><img class="size-full wp-image-577" title="ブログパーツを作る" src="http://jbar.jp/ishima/wp-content/uploads/2010/01/WS000004.JPG" mce_src="http://jbar.jp/ishima/wp-content/uploads/2010/01/WS000004.JPG" alt="ブログパーツを作る" width="207" height="166"></dt>
<dd class="wp-caption-dd">ブログパーツを作る</dd>
</dl>
</div>
<p>質問と選択肢、選択肢が選択された数をDBに格納しておく。<br />
このひな形のDBさえ作っておけばあとはどの質問を表示させるかだけの話なので、スクリプトの使い回しができる。</p>
<p>「答える」をクリックするとDBから現在のデータを取得してバーで表示する。<br style="clear:both;" mce_style="clear:both;"></p>
<div class="mceTemp">
<dl id="attachment_585" class="wp-caption alignleft" style="width: 310px">
<dt class="wp-caption-dt"><img class="size-medium wp-image-585" title="テーブルの構造" src="http://jbar.jp/ishima/wp-content/uploads/2010/01/WS000005-300x100.jpg" mce_src="http://jbar.jp/ishima/wp-content/uploads/2010/01/WS000005-300x100.jpg" alt="テーブルの構造" width="300" height="100"></dt>
<dd class="wp-caption-dd">テーブルの構造</dd>
</dl>
</div>
<p>テーブルは「質問の番号」「質問の内容」「選択肢１」「選択肢２」「選択肢３」「選択肢１の選択数」「選択肢２の選択数」「選択肢３の選択数」で構成した。選択肢の数を最大５程度で作っておいてもよいかもしれない。</p>
<p>左の画像ではわからないが、本来はウェブサイトにブログパーツとして貼り付けているが、ページ全体を読み込みしなおさないので動きがスムーズだ。<br />
アクションの取得などはJavaScriptが行い、それ以外をPHPで処理しているので、一応Ajaxなブログパーツということになるのかな？</p>
<p>左の例ではバーはパーセント表示だが、もちろん数量でも表示できる。</p>
<p>まだまだアイデアは湧きそうだ。</p>
<div class="mceTemp">
<dl id="attachment_578" class="wp-caption alignleft" style="width: 220px">
<dt class="wp-caption-dt"><img class="size-full wp-image-578" title="ブログパーツを作る" src="http://jbar.jp/ishima/wp-content/uploads/2010/01/WS000003.JPG" mce_src="http://jbar.jp/ishima/wp-content/uploads/2010/01/WS000003.JPG" alt="ブログパーツを作る" width="210" height="261"></dt>
<dd class="wp-caption-dd">ブログパーツを作る</dd>
</dl>
</div>
<img src="http://jbar.jp/ishima/?ak_action=api_record_view&id=576&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jbar.jp/ishima/it/blog_parts_20100111.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/it/blog_parts_20100111.html" />
	</item>
	</channel>
</rss>

