Javascript、慣れると結構楽しいですよね。それはそうとURLからamazonアソシエイツのIDを削るのは正規表現を使うともっと簡単になりませんか? 自作のGreasmonkeyのスクリプトを見たら以下のような関数がありました。 function link_to_asin(link) { if (link.match(/\/(ASIN|asin|asininfo)\/([^\/]+)/)) return RegExp.$2; return null; }これはAmazon, はてな, blogmapのURLからASINを得る関数ですが、流用できそうなので。
> 正規表現を使うともっと簡単に アウア、その通りですね、短くなります。正規表現の使いかたを調べるのが面倒で後回しにしてました。 サンプルありがとうございますー。
Hi there, I've surely got to claim, I really like your website. The hues, the design, the entire style, all of them go perfectly together. Anyway, that's all I really needed to state.