PageSourceSearch

https://cc.cqpub.co.jp/js/public.js

js cqpub.co.jp collected 2026-10-02 03:43:56 UTC 1,117 bytes, 32 lines download raw bytes

1/* vim: set tabstop=2 shiftwidth=2 foldmethod=marker: */
2/**
3 * @author      Shogo Kawase <[email protected]>
4 * @copyright   2007-2008 Arc Style Inc.
5 * @version     CVS: $Id$
6 */
7vw.public = {};
8
9vw.public.postalSearch = function(url, key)
10{
11	document.write('<input type="button" name="postalSearchBtn" id="postalSearchBtn" value="検索" />');
12	$('#postalSearchBtn').bind('click', function(e){
13		var zip = [$$(key + '-zip1').value, $$(key + '-zip2').value];
14		if (isNaN(zip[0]) || isNaN(zip[1]) || zip[0].length < 3 || zip[1].length < 4) {
15			return alert('郵便番号は7桁全て正確に入力してください');
16		}
17		var params = {zipcode: zip.join('-')};
18		$.getJSON(url + '/postal/', params, function(json){
19			if (!json.count) {
20				alert('該当する住所が見つかりませんでした。');
21			} else {
22				$('#' + key + '-pref').val(json.pref_code);
23				$('#' + key + '-city').val(json.city_name);
24				$('#' + key + '-addr').val(json.town_name);
25				$('#' + key + '-row').effect('highlight', {}, 1000);
26				vw.form.cursorMoveToEnd($('#' + key + '-addr')[0]);
27			}
28		});
29		return false;
30	});
31};
32

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.