PageSourceSearch

https://anguo.gov.cn/js/newsInfo.js?v=1.2

js anguo.gov.cn collected 2026-10-02 22:03:07 UTC 5,395 bytes, 140 lines download raw bytes

1$(function () {
2    if (getQueryString('cid')) {
3        xiangzhenAjax()
4    } else if (getQueryString('nid')) {
5        newsaAjax()
6    }
7    
8})
9function getQueryString(name) {
10    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
11    var r = window.location.search.substr(1).match(reg);
12    if (r != null) {
13        return unescape(r[2]);
14    }
15    return null;
16}
17function newsaAjax() {
18    $.ajax({
19        type: "POST",
20        url: "/api/Portal/GetInfoPage",
21        data: JSON.stringify({
22            "posttype": "GetLmValue_field",
23            "valueid": getQueryString('nid')
24        }),
25        dataType: 'json',
26        success: function (res) {
27	    if(!res.model)
28	    {
29		alert("文章不存在!");
30		window.location.href="/";
31		return;
32            }
33            if (getQueryString('lmid') == '21' && res.model.logo != '') {
34                $('.info-images').show()
35                $('.info-images img').attr('src', res.model.logo).attr('alt', res.model.title)
36            }
37            $('#info').html(res.model.memo)
38            $('#title').html(res.model.title)
39		$("[name='ArticleTitle']").attr("content",res.model.title);
40            if (res.prvName != '') {
41                $(".prev-btn").show();
42                $('#prvSpan').html(res.prvName)
43                $('#prvSpan').attr("href", "/info.html?lmid=" + res.model.lmid + "&nid=" + res.prvid)
44            } else {
45                $(".prev-btn").hide();
46            }
47            if (res.NextName != '') {
48                $(".next-btn").show();
49                $('#NextSpan').html(res.NextName)
50                $('#NextSpan').attr("href", "/info.html?lmid=" + res.model.lmid + "&nid=" + res.Nextid)
51            } else {
52                $(".next-btn").hide();
53            }
54
55
56            $('#newsAbout').html('发布时间:' + getTime(res.model.udt) + ' 发布者:管理员 点击:' + res.model.click);
57	    $("[name='PubDate']").attr("content",res.model.udt);
58	    $("[name='ArticleTitle']").attr("content",res.model.title);
59            if (res.model.lmid == '14' && res.model.files != '') {
60                $('#video').show()
61                var videoUrl = res.model.files;
62                var ext = videoUrl.split('?')[0].split('.').pop().toLowerCase();
63                
64                // 创建 video 元素
65                var videoHtml = '<video id="videoPlayer" controls="controls" style="width:100%;height:100%;background:#000;"></video>';
66                $('#videoC').html(videoHtml);
67                
68                var videoElement = document.getElementById('videoPlayer');
69                
70                if (ext === 'flv' && window.flvjs && flvjs.isSupported()) {
71                    // flv 格式用 flv.js 播放
72                    var flvPlayer = flvjs.createPlayer({
73                        type: 'flv',
74                        url: videoUrl
75                    });
76                    flvPlayer.attachMediaElement(videoElement);
77                    flvPlayer.load();
78                } else {
79                    // mp4 等格式用原生 video 播放
80                    videoElement.src = videoUrl;
81                }
82            }
83        }
84    });
85    $('.prev-btn').click(function () {
86        $.ajax({
87            type: "POST",
88            url: "/api/Portal/GetInfoPage",
89            data: JSON.stringify({
90                "posttype": "GetPrevLmValue_field",
91                "valueid": getQueryString('cid') || getQueryString('nid'),
92                "lmid": getQueryString('lmid')
93            }),
94            dataType: 'json',
95            success: function (res) {
96                $('#info').html(res.model.memo)
97                $('#title').html(res.model.title)
98                $('#newsAbout').html('发布时间:' + getTime(res.model.udt) + ' 发布者:管理员 点击:' + res.model.click)
99            }
100        });
101    })
102    $('.next-btn').click(function () {
103        $.ajax({
104            type: "POST",
105            url: "/api/Portal/GetInfoPage",
106            data: JSON.stringify({
107                "posttype": "GetNextLmValue_field",
108                "valueid": getQueryString('cid') || getQueryString('nid'),
109                "lmid": getQueryString('lmid')
110            }),
111            dataType: 'json',
112            success: function (res) {
113                $('#info').html(res.model.memo)
114                $('#title').html(res.model.title)
115                $('#newsAbout').html('发布时间:' + getTime(res.model.udt) + ' 发布者:管理员 点击:' + res.model.click)
116            }
117        });
118    })
119}
120function xiangzhenAjax() {
121    $.ajax({
122        type: "POST",
123        url: "/api/Portal/GetInfoPage",
124        data: JSON.stringify({
125            "posttype": "GetLmValue_field",
126            "valueid": getQueryString('cid'),
127            "lmid": getQueryString('lmid')
128        }),
129        dataType: 'json',
130        success: function (res) {
131            $('#info').html(res.model.memo)
132            $('#title').html(res.model.title)
133            $('#newsAbout').html('发布时间:' + getTime(res.model.udt) + ' 发布者:管理员 点击:' + res.model.click)
134        }
135    });
136}
137function getTime(dt) {
138    var _date = new Date(dt)
139    return _date.getFullYear() + "-" + (_date.getMonth() + 1) + "-" + _date.getDate()
140}

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.