<?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>blog.grayash.com &#187; JavaScript</title>
	<atom:link href="http://blog.grayash.com/archives/category/web/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.grayash.com</link>
	<description>Webデザイナーによるブログ。日々勉強</description>
	<lastBuildDate>Fri, 29 Oct 2010 20:59:59 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.grayash.com/archives/category/web/javascript/feed" />
		<item>
		<title>jQueryを利用したalt、description、keywordチェック</title>
		<link>http://blog.grayash.com/archives/1016?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jquery%25e3%2582%2592%25e5%2588%25a9%25e7%2594%25a8%25e3%2581%2597%25e3%2581%259falt%25e3%2580%2581description%25e3%2580%2581keyword%25e3%2583%2581%25e3%2582%25a7%25e3%2583%2583%25e3%2582%25af</link>
		<comments>http://blog.grayash.com/archives/1016#comments</comments>
		<pubDate>Tue, 24 Nov 2009 04:12:49 +0000</pubDate>
		<dc:creator>suniti</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ｊQuery]]></category>

		<guid isPermaLink="false">http://blog.grayash.com/?p=1016</guid>
		<description><![CDATA[WordPressのログイン画面で2回パスワード間違えたsunitiです。前にエントリー書いたのいつだろ・・・？ 少し前の話になりますが、linker journalの「普段読んでるRSS一覧でも＜Web制作系編＞」とい [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressのログイン画面で2回パスワード間違えたsunitiです。前にエントリー書いたのいつだろ・・・？</p>
<p>少し前の話になりますが、<a href="http://linker.in/journal/">linker journal</a>の「<a href="http://linker.in/journal/2009/10/rssweb.php">普段読んでるRSS一覧でも＜Web制作系編＞</a>」というエントリーにこのブログが載ってるのを見かけて心苦しくなったので何か書こうと思った次第です。<br />
deliciousが自動更新するブログになっていてホントすんまへん。へこへこ。</p>
<p>さて、皆さんはalt、description、keywordsのチェックはどうされてますか？<br />
下階層で同じようなレイアウトのページが続くと前回作ったものをコピーして作ったりしますが、その際にalt、description、keywordsを<strong>更新し忘れてて公開後にギャース</strong>となることが<strong>まれ</strong>にあります。</p>
<p>数ページのサイトであればチェックも手間では無いのですが、数百ページとかになるとaltチェックだけでもかなりの手間になります。<br />
そこで自分はjQueryでコードを書きテストサーバーにアップ後、それを読み込ませてブラウジングしながらチェックしています。</p>
<p><img src="http://blog.grayash.com/wp-content/alt_description_keyword.jpg" alt="alt_description_keyword" title="alt_description_keyword" width="610" height="171" class="alignnone size-full wp-image-1024" /></p>
<p>左の画像がJSを読み込ませる前、右が今回のコードを読み込ませた後</p>
<p>右の左側（わかりにくいな）の画像にはaltが入っているので画像の左上にaltテキストが表示されます。<br />
右の右側の画像はaltが抜けていたので画像に枠がつきます。</p>
<p>また、body直下にdescriptionとkeywordが出力されます。<br />
bodyに背景画像でごにょごにょしてる場合は崩れる可能性大！（まぁチェックだからいいよね）</p>
<p><code></p>
<pre class="brush: jscript; title: ; notranslate">
$(function(){
//description、keywordチェック
	$(&quot;body&quot;).prepend('&lt;div&gt;description: ' + $(&quot;meta:[name^='description']&quot;).attr(&quot;content&quot;) + '&lt;/div&gt;');
	$(&quot;body&quot;).prepend('&lt;div&gt;keywords   : ' + $(&quot;meta:[name^='keywords']&quot;).attr(&quot;content&quot;) + '&lt;/div&gt;');

//altチェック
	$(&quot;img&quot;).each(function(){
		var h = $(this).height();
		if($(this).attr(&quot;alt&quot;)){
			$(this).after('&lt;div style=&quot;z-index:999;position: absolute;background-color: #333; color:#FFF; font-size:10px; padding:5px;margin-top:-' + h + 'px;&quot;&gt;' + $(this).attr(&quot;alt&quot;) + '&lt;/div&gt;');
		}
		else{
			$(this).css({ backgroundColor:&quot;#F00&quot;, padding:&quot;5px&quot; });
		}
	});
});
</pre>
<p></code></p>
<p>無理やり出力させてたりするので、画像の上にaltテキストが乗らなかったりしますが、その辺は見なかった体でお願いします。</p>
<p>jQuery1.3.2＆Firefox以外では<del datetime="2009-11-24T03:59:46+00:00">めんどくさくて</del>チェックしてませんので動かなかったらごめんなさい。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.grayash.com/archives/1016/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.grayash.com/archives/1016" />
	</item>
		<item>
		<title>MyMiniCityがちょっと便利になるGreasemonkey</title>
		<link>http://blog.grayash.com/archives/577?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=myminicity%25e3%2581%258c%25e3%2581%25a1%25e3%2582%2587%25e3%2581%25a3%25e3%2581%25a8%25e4%25be%25bf%25e5%2588%25a9%25e3%2581%25ab%25e3%2581%25aa%25e3%2582%258bgreasemonkey</link>
		<comments>http://blog.grayash.com/archives/577#comments</comments>
		<pubDate>Thu, 20 Dec 2007 07:21:47 +0000</pubDate>
		<dc:creator>suniti</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ゲーム]]></category>

		<guid isPermaLink="false">http://blog.grayash.com/archives/577</guid>
		<description><![CDATA[先日から巷で話題のMyMiniCityがちょっと便利になるGreasemonkeyがあったので、紹介します。 コメント機能もついて、他の街にコメントとかが書き込めるのですが、コメントとかもらっても、相手の街に行くのにコピ [...]]]></description>
			<content:encoded><![CDATA[<p>先日から巷で話題のMyMiniCityがちょっと便利になるGreasemonkeyがあったので、紹介します。</p>
<blockquote>
<p>コメント機能もついて、他の街にコメントとかが書き込めるのですが、コメントとかもらっても、相手の街に行くのにコピペしないといけないのでめんどくさいです。</p>
<p>そこで、コメントの名前を自動的にリンクに変更するグレースモンキースクリプトを作りました。</p>
<p><cite><a href="http://blog.webcreativepark.net/2007/12/19-184341.html">MyMiniCityを楽しむためのGMスクリプト[to-R]</a></cite>
</p></blockquote>
<p><a href="http://blog.webcreativepark.net/">[to-R]</a>さんのグリモンは、コメント欄に書き込まれた名前の部分をリンクに変えてくれるグリモン。</p>
<p>これ便利だなーと思って入れた矢先に、もう一つ発見＞＜</p>
<blockquote>
<p>to-Rさんで公開されているぐりもんは，ユーザ名からURLへの置換方法が不十分だったで正規表現で設定しなおしました．具体的には，_（アンダスコア）とか:（コロン）とか，URLに使える文字として許されているのに，MyMiniCityのURLでは削られる文字をユーザ名に含むときにうまくいってませんでした．</p>
<p>また，ついでなのでコメント投稿時間も時差を考慮して国際対応にしてみました．このぐりもんを使う人の国の時間で表示しなおします．</p>
<p><cite><a href="http://blog.fulltext-search.biz/articles/2007/12/19/greasemonkey-myminicity">We Ain't Seen Nothin' Yet. : MyMiniCityを楽しむためのGMスクリプト+α</a></cite>
</p></blockquote>
<p><a href="http://blog.fulltext-search.biz/">We Ain't Seen Nothin' Yet.</a>さんのグリモンは、さらに時間も日本時間で表示してくれるようになるのでもっと便利に＞＜</p>
<dl>
<dt>関連リンク</dt>
<dd><a href="http://myminicity.com/">MyMiniCity</a></dd>
<p><a href="http://blog.webcreativepark.net/2007/12/19-184341.html">MyMiniCityを楽しむためのGMスクリプト[to-R]</a></p>
<dd><a href="http://blog.fulltext-search.biz/articles/2007/12/19/greasemonkey-myminicity">We Ain't Seen Nothin' Yet. : MyMiniCityを楽しむためのGMスクリプト+α</a></dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://blog.grayash.com/archives/577/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.grayash.com/archives/577" />
	</item>
		<item>
		<title>USTREAM.tvのダラ見を防止するグリモンを書いてみた</title>
		<link>http://blog.grayash.com/archives/531?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ustreamtviyayeoeesseyyeyayoonaess</link>
		<comments>http://blog.grayash.com/archives/531#comments</comments>
		<pubDate>Tue, 31 Jul 2007 04:05:20 +0000</pubDate>
		<dc:creator>suniti</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.grayash.com/archives/531</guid>
		<description><![CDATA[最近、Twitter界隈で大人気のUSTREAM.tv。面白すぎる！ 面白すぎて、ついついダラ見しちゃって、「やっべ！仕事してねーじゃん！＞＜」という事がしばしば。 そんなダラ見を防ぐグリモンを書いたよ！(n'∀')η  [...]]]></description>
			<content:encoded><![CDATA[<p>最近、Twitter界隈で大人気の<a href="http://ustream.tv/">USTREAM.tv</a>。面白すぎる！<br />
面白すぎて、ついついダラ見しちゃって、「やっべ！仕事してねーじゃん！＞＜」という事がしばしば。</p>
<p>そんなダラ見を防ぐグリモンを書いたよ！(n'∀')η<br />
やってることは簡単、5分おきにアラートが出るだけ！自分で好きな時間とメッセージに書き換えて使うといいよ！(n'ω'n)</p>
<p><a href="http://blog.grayash.com/blog_images/ustream_timer.user.js">ustream_timer.jsをダウンロードする！</a>（要<a href="http://www.greasespot.net/">Greasemonkey</a>）</p>
<pre title="ustream_timer.user.js">
<code>
// ==UserScript==
// @name        USTREAM_TIMER
// @namespace   http://blog.grayash.com/
// @include     http://www.ustream.tv/*
// @include     http://ustream.tv/*
// @version     1.0
// ==/UserScript==
(function(){
	var UT_timeID;
	var sec=0;
	UT_settime = 5; //アラートを出す間隔（分）
	UT_message = new Array( "経過。そんなに見ちゃダメ！＞＜",
				"経過したけど、仕事は？",
				"経過したよ？仕事しようよ！",
				"も見てるんだけど・・・",
				"経過。USTREAM自重wwww");
	function UT_interval(){
		sec = sec+UT_settime;
		window.alert(sec + "分" + UT_message[Math.floor( Math.random() * UT_message.length )]);
	}
	UT_timeID = setInterval( UT_interval, (UT_settime*60000) );
})();
</code>
</pre>
<p>あんまり動作確認していないので、動かなかったらこっそり教えてくだしあ＞＜<br />
ちなみに自分はカメラ持ってないので見る専門ですよ(n'∀')η</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.grayash.com/archives/531/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.grayash.com/archives/531" />
	</item>
		<item>
		<title>jQueryでナウでヤングなポップアップを開く</title>
		<link>http://blog.grayash.com/archives/520?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jquerycyeycyayoyeyyyayycyayo</link>
		<comments>http://blog.grayash.com/archives/520#comments</comments>
		<pubDate>Wed, 20 Jun 2007 15:26:26 +0000</pubDate>
		<dc:creator>suniti</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://blog.grayash.com/archives/520</guid>
		<description><![CDATA[今日、「ポップアップ」を連呼するクライアントと話しました。久しぶりに聞いたぜ「ポップアップ」。 最近jQueryの勉強をしてるので、ソレで昼休みに作ってみました。 ポップアップするファイルを1つのフォルダにまとめておけば [...]]]></description>
			<content:encoded><![CDATA[<p>今日、「ポップアップ」を連呼するクライアントと話しました。久しぶりに聞いたぜ「ポップアップ」。</p>
<p>最近jQueryの勉強をしてるので、ソレで昼休みに作ってみました。<br />
ポップアップするファイルを1つのフォルダにまとめておけば、自動的にポップアップでやってくれるよ！<br />
これはナウい。ただし、ウィンドウサイズは固定なのでチョベリバ。</p>
<pre><code>
//ポップアップで開く
&lt;a href=&quot;./shop/popup.html&quot;&gt;ポップアップで開く&lt;/a&gt;
//同じウィンドウで開く
&lt;a href=&quot;./food/apple.html&quot;&gt;同じウィンドウで開く&lt;/a&gt;
</code></pre>
<pre><code>
//A要素のURLに「./shop/」と入っていればポップアップでウィンドウを開く。
$(function(){
$('a[@href~="./shop/"]').click(function(){
window.open(this.href, "shop","width=400,height=300");
return false;
});
});
</code></pre>
<p>もちろんネタですよ？</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.grayash.com/archives/520/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.grayash.com/archives/520" />
	</item>
	</channel>
</rss>

