期間限定ものに対する3つの方法 | main | index.phpにアクセスしたら、index.tmpl.htmlを読み込むよっていうソース

encodeURIComponent術を使って、検索キーワードを日本語でリンクする

フューチャーショップでサイトを構築していたところ、
カテゴリーやグループ以外に、
キーワード検索を使って、
タイプ別、色別や用途別などリンクを張りたいとき。

keyword=検索ワード

としたいのに

keyword=%8C%9F%8D%F5%83%8F%81%5B%83h

どうしても↑こういう風に記述する羽目になります。。。

これでは、
合っているのか間違っているのか、見直せませんし、
リンクを作るときも、いちいちソースを変換しないといけません。

10個程度までなら許せますが、
50個、100個となったらリンク張りだけで夜がふけます┐(・ε・`)┌


そんなとき、
ちゃんとencodeURIComponent術を使いましょう。

<a href="javascript:;" onclick="location.href='http://xxxxx.com/fs/xxxxx/GoodsSearchList.html?_e_k='+encodeURIComponent('A')+'&keyword='+encodeURIComponent('検索ワード');">検索ワード</a>


これなら、日本語なので、
HTMLソースを見ただけで分かります♪

future shop以外でも、使えるかもしれませんね。

Comments

search engine optimization vancouver | 2012/03/02 06:49 PM
I want to say that you really helped me to understand the subject of px*blog | encodeURIComponent術を使って、検索キーワードを日本語でリンクする
social media marketing | 2012/03/02 04:34 PM
I appreciate all the effort you put into writing this post about px*blog | encodeURIComponent術を使って、検索キーワードを日本語でリンクする . I will post a backlink back to your blog on my website as I think some of my clients might find it interesting.
web agency vancouver | 2012/02/27 12:40 AM
px*blog | encodeURIComponent術を使って、検索キーワードを日本語でリンクする Is what I was looking for. Thank you for the information.
neaniupenny | 2011/12/15 07:54 PM
仂亟 仗亠亠于亳 <b>仗亠亠于亳 于 弍舒亰亳仍亳 </b>
<a href=http://hutravel.ru/%D0%B3%D0%B5%D1%80%D0%BC%D0%B0%D0%BD%D0%B8%D1%8F/%D0%B2%D0%BE%D0%BA%D1%80%D1%83%D0%B3-%D1%82%D0%B8%D1%80%D0%B3%D0%B0%D1%80%D1%82%D0%B5%D0%BD%D1%88%D1%82%D1%80%D0%B0%D1%81%D1%81%D0%B5>仗亠亠于亳 仂舒 </a> 仗亠亠于亳 亳舒仍亳 仗亠亠于亳 于 仗舒亞 舒弍仂舒 仂亟 仗亠亠于亳

Post


ご利用のブラウザ、設定ではご利用になれません。

Trackbacks

Categories