PageSourceSearch

https://www.city.morioka.iwate.jp/_template_/_site_/_default_/_res/js/id.js

js city.morioka.iwate.jp collected 2026-10-02 05:16:56 UTC 1,547 bytes, 58 lines download raw bytes

1(function(){
2	var $ = FI.jQuery;
3
4	$( function() {
5		$( '#idform' ).on("submit", function() {
6			var errFlag=0;            
7			var pageurl="";
8			var findText = document.idform.idtxt.value; // 検索する文字
9			if(findText.length != 7){
10				errFlag=1; 
11			}else if(findText.match(/[^0-9]+/)){ 
12				errFlag=1; 
13			}
14
15			if(errFlag == 1){
16				$( '#idresult' ).remove();
17				$( '.navidetail' ).append( '<div id="idresult"><p>ID番号は半角数字7桁で入力してください。</p></div>' );
18			}else{
19				/*検索ワード取得*/
20				getData(true);
21			}
22
23			return false;
24			}
25		);
26
27		function getData(cache_f){
28			var pageurl="";
29			var findText = document.idform.idtxt.value; // 検索する文字
30
31			/*検索ワード取得*/
32			$.ajax({
33				type: "GET",
34				scriptCharset: 'utf-8',
35				url: "https://www.city.morioka.iwate.jp/allpages.json",
36				dataType : 'json',
37				success: function(data) {
38				pageurl=data[findText];
39					if(pageurl != null){
40						window.open(pageurl,"_self");
41					}else{
42						//IDが見つからない場合→1回目:キャッシュを破棄して再読込、2回目:エラー表示
43						if (cache_f){
44							getData(false);
45						}else{
46							$( '#idresult' ).remove();
47							$( '.navidetail' ).append( '<div id="idresult"><p>該当のページはありません。</p></div>' );
48						}
49					}
50				},
51				error: function(){
52					$( '#idresult' ).remove();
53					$( '.navidetail' ).append( '<div id="idresult"><p>ID検索マスタファイル取得エラー</p></div>' );
54				}
55			});
56		}
57	});
58})();

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.