PageSourceSearch

https://kyushu-energy.co.jp/simulation/enegaeru_ajax.js

js kyushu-energy.co.jp collected 2026-10-07 23:11:51 UTC 2,859 bytes, 81 lines download raw bytes

1
2/**
3 * 
4 * @param {string} sendValue	// GETのリクエスト 
5 * @param {string} id		 	// 結果を表示する先
6 */
7function enegaeruAjax( sendValue, id ) {
8	
9		console.log("[sendValue]:"+sendValue);
10		console.log("[id]:"+id);
11		sendValue = sendValue + "&id=" + id.slice(1);
12		console.log("[sendValue+id]:"+sendValue);
13		
14		// 1.$.ajaxメソッドで通信を行います。
15		$.ajax({
16			type: "GET", 							// 使用するHTTPメソッド
17			url:'./enegaeru_api.php',		 		// 通信先のURL
18			data: sendValue, 						// 送信するデータ
19			dataType: "text", 						// 応答のデータの種類 
20			timespan:1000 							// 通信のタイムアウトの設定(ミリ秒)
21		
22		// 2. doneは、通信に成功した時に実行される
23		//  引数のdataは、通信で取得したデータ
24		//  引数のtextStatusは、通信結果のステータス
25		//  引数のjqXHRは、XMLHttpRequestオブジェクト
26		}).done(function(data, textStatus, jqXHR){
27			$(id).html(data);
28			$("#result2").text(textStatus);
29			$("#result3").text(jqXHR);
30		
31		// 3. failは、通信に失敗した時に実行される
32		}).fail(function(jqXHR, textStatus, errorThrown ){
33			$("#result1").text(jqXHR.status); 		//例:404
34			$("#result2").text(textStatus); 		//例:error
35			$("#result3").text(errorThrown); 		//例:NOT FOUND
36		
37		// 7. alwaysは、成功/失敗に関わらず実行される
38		}).always(function(){
39		//	$("#result4").text("complete");
40			$('#overlay').hide();
41		});
42}
43
44function prefAjax( zipcode ) {
45	
46	console.log("[zipcode]:"+zipcode);
47	
48	// 1.$.ajaxメソッドで通信を行います。
49	$.ajax({
50		type: "GET", 							// 使用するHTTPメソッド
51		url:'./pref_api.php', 					// 通信先のURL
52		data: zipcode,							// 送信するデータ
53		dataType: "text", 						// 応答のデータの種類 
54		timespan:1000 							// 通信のタイムアウトの設定(ミリ秒)
55	
56	// 2. doneは、通信に成功した時に実行される
57	//  引数のdataは、通信で取得したデータ
58	//  引数のtextStatusは、通信結果のステータス
59	//  引数のjqXHRは、XMLHttpRequestオブジェクト
60	}).done(function(data, textStatus, jqXHR){
61		// $("#pref").val(data);
62		setData(data);
63		$("#result2").text(textStatus);
64		$("#result3").text(jqXHR);
65	
66	// 3. failは、通信に失敗した時に実行される
67	}).fail(function(jqXHR, textStatus, errorThrown ){
68		$("#result1").text(jqXHR.status); 		//例:404
69		$("#result2").text(textStatus); 		//例:error
70		$("#result3").text(errorThrown); 		//例:NOT FOUND
71	
72	// 7. alwaysは、成功/失敗に関わらず実行される
73	}).always(function(){
74	//	$("#result4").text("complete");
75		$('#overlay').hide();
76	});
77}
78function setData(data) {
79	$('#pref').val(data);
80	setPref();
81}

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.