memo.xight.org

/ / memo.xight.org

2005-02-19

Amazon の画像置換

- Summary
chalow で Amazon の画像置換を利用してみる.

- amazon.js
function replaceImage(img) {
	if (img.width == '1' && img.src.match(/\.01\./)) {
		img.src = 'http://images-jp.amazon.com/images/G/09/x-locale/detail/thumb-no-image.gif';
		img.width = 98;
		img.height = 140;
	} else if (img.width == '1') {
		img.src = img.src.replace('.09.','.01.');
	}
}


- cl.conf
  - 各 head タグ内に記述
<script src="path/to/amazon.js" type="text/javascript"></script>


  - amazon リンクの作成プラグインを変更
<img src="/path/to/image" onload="replaceImage(this)" />


- Reference
  hail2u.net - 2004-05-30 - Amazon の画像置換 #2
  http://hail2u.net/blog/coding/air_2.html
カテゴリ: [Amazon][JavaScript][chalow]
2005-02 /

Color Reference

ChangeLogを検索
携帯電話からアクセス!

カテゴリ

最近の話題

リンク

過去ログ

Google

QR Code

Since
2002-11-28
Update
2008-09-05 14:14
Copyright © 2005 xight.org All Rights Reserved.