PageSourceSearch

https://data.gov.hk/assets/shared/js/scripts/footer.js?v=1

js data.gov.hk collected 2026-10-02 02:24:12 UTC 2,355 bytes, 66 lines download raw bytes

1function Footer() {
2    this.init = function() {
3        setup();
4    };
5
6    function setup() {
7        var $formRedirect = $('.js-feedback-form'),
8            currentUrl = window.location.href.split('?')[0],
9            $datasetDetailPage = $('#dataset-details-result'),
10            $resourceDetailPage = $('#resource-url');
11
12        if ($formRedirect.length) {
13            $formRedirect.each(function () {
14                // Sample: provider=${$parsedProvider}&dataset=${$parsedDatasetName}&url=${$parsedUrl}&referrer=${referrer}`;
15                let url = `/${getLang()}/feedback?`; 
16                // let url = '?';
17                let hasParam = false;
18
19                const urlParts = currentUrl.split('/');
20
21                if (urlParts.indexOf('providers') !== -1 || currentUrl.includes('-datasets')) {
22                    url += `&type=exist`;
23                    hasParam = true;
24                }
25
26                const providerIndex = urlParts.indexOf('provider');
27                if (providerIndex !== -1 && providerIndex < urlParts.length - 1) {
28                    url += `&provider=${urlParts[providerIndex + 1]}`;
29                    hasParam = true;
30                }
31
32                if ($datasetDetailPage.length) {
33                    const providerId = $datasetDetailPage.data('org-id');
34                    url += `&provider=${providerId ?? ''}`;
35
36                    const datasetName = $.trim($('.page-title').text());
37                    url += `&dataset=${datasetName ?? ''}`;
38                    hasParam = true;
39                }
40
41                if ($resourceDetailPage.length) {
42                    const $detail = $('#res-details');
43                    const providerId = $detail.data('dataset-org-id');
44                    url += `&provider=${providerId ?? ''}`;
45
46                    const datasetName = $detail.data('dataset-name');
47                    url += `&dataset=${datasetName ?? ''}`;
48                    hasParam = true;
49                }
50
51                if ($datasetDetailPage.length || $resourceDetailPage.length) {
52                    url += `&url=${currentUrl}`;
53                    hasParam = true;
54                }
55
56                if (!hasParam) {
57                    url = url.replace('?', '');
58                }
59
60                $(this).attr('href', url);
61            });
62        }
63    }
64
65    
66};

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.