住所の単語から郵便番号を検索する
jQuery coder プラグイン を使って、指定した住所の単語から郵便番号を検索し、その結果をリスト表示します。
<script type="text/javascript">
//<![CDATA[
jQuery(function($) {
jQuery(document.f)
.submit(function() {
jQuery('#r')
.empty()
.coder(this.a.value, function(response) {
jQuery.each(response, function() {
jQuery('<li>')
.text(this.c)
.appendTo('#r');
});
});
return false;
});
});
//]]>
</script>
<form name="f">
<input type="text" name="a" value="横浜" />
<input type="submit" name="g" value="検索" />
</form>
<ul id="r"></ul>
関連情報
- ベーシック
- 送信フォーム
- with jQuery
- Google Maps API
- BLOGRANGER API
