PageSourceSearch

https://www.city.ichinomiya.aichi.jp/_template_/_site_/_default_/_res/js/recommend.js

js city.ichinomiya.aichi.jp collected 2026-10-02 05:38:36 UTC 2,363 bytes, 69 lines download raw bytes

1//------------------------------------------------------------------------------
2//	レコメンド機能
3//	Copyright (C) 2021 FUTUREINN CO., LTD. All Rights Reserved.
4//------------------------------------------------------------------------------
5
6(function(){
7  var $ = FI.jQuery;
8  //---------------------------------------
9  // ▼ 設定
10  //---------------------------------------
11  // 表示件数
12  p_count = 3;
13  //---------------------------------------
14
15
16
17  var api = "https://ichinomiya.ficsc.jp/ichinomiya/api/recommend.htm?id=";
18//  var this_page = location.href;
19  var this_page = FI.my_page_url;
20  var api_call = api + encodeURIComponent(this_page);
21
22  fetch(api_call, {
23    method: "GET",
24  })
25  .then(function(response) {
26    return response.json();
27  })
28  .then(function(json) {
29    var html = "";
30    // if json["error"]が存在しない時または存在しても空の時に以下の処理を行う★
31    if (json["error"] == 'undefined' || !json["error"]){
32      var contents = json["contents"];
33      if(contents.length > 0){
34        var link_cnt = 0;
35        $.each(contents, function(index, content) {
36          // 5件のみ表示する
37          if(link_cnt < 5){
38            // if content["info"]が存在しない時または存在しても空の時にページタイトルをダミーのものとする★
39            // ページ名がない場合は出力しない
40            if(content["info"] != 'No name found.' && content["name"] != "") {
41              html += '<li><a href="' + content["id"] + '">' + content["name"] + '</a></li>';
42              link_cnt = link_cnt + 1;
43            }
44          }
45        })
46        // 1件も表示するリンクがない時は出力を行わない
47        if(link_cnt > 0){
48          $("#reccomend ul").html(html);
49          // レコメンド、リマインド共通divを表示
50          $('#supportbg').show();
51          $('#reccomend').show();
52        }
53      }else{
54        // レコメンドページなし
55        $('#reccomend').hide();
56console.log('レコメンドページなし','error:',json["error"],'contents:',json["contents"]);
57      }
58    }else{
59      // レコメンド情報なし
60      $('#reccomend').hide();
61console.log('レコメンド情報なし',json["error"]);
62    }
63    // end
64  }).catch(function(error) {
65console.log('接続失敗', error);
66  });
67})();
68
69

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.