PageSourceSearch

https://scanlb.com/static/js/function.js

js scanlb.com collected 2026-10-04 15:02:14 UTC 9,755 bytes, 321 lines download raw bytes

1// JavaScript Document
2//交换图象存储
3function MM_swapImgRestore() { //v3.0
4    var i, x, a = document.MM_sr;
5    for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
6}
7function openNewWindow(url) {
8    $('body').append($('<a href="' + url + '"  id="openNewWindow"></a>'))
9    document.getElementById("openNewWindow").click(); //点击事件
10    $('#openNewWindow').remove();
11}
12//预载入图象
13function MM_preloadImages() { //v3.0
14    var d = document;
15    if (d.images) {
16        if (!d.MM_p) d.MM_p = new Array();
17        var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
18        for (i = 0; i < a.length; i++)
19            if (a[i].indexOf("#") != 0) {
20                d.MM_p[j] = new Image;
21                d.MM_p[j++].src = a[i];
22            }
23    }
24}
25
26//查找对象
27function MM_findObj(n, d) { //v4.01
28    var p, i, x;
29    if (!d) d = document;
30    if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
31        d = parent.frames[n.substring(p + 1)].document;
32        n = n.substring(0, p);
33    }
34    if (!(x = d[n]) && d.all) x = d.all[n];
35    for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
36    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
37    if (!x && d.getElementById) x = d.getElementById(n);
38    return x;
39}
40
41//交换图象
42function MM_swapImage() { //v3.0
43    var i, j = 0, x, a = MM_swapImage.arguments;
44    document.MM_sr = new Array;
45    for (i = 0; i < (a.length - 2); i += 3)
46        if ((x = MM_findObj(a[i])) != null) {
47            document.MM_sr[j++] = x;
48            if (!x.oSrc) x.oSrc = x.src;
49            x.src = a[i + 2];
50        }
51
52}
53
54//隐藏显示层
55function MM_showHideLayers() { //v9.0
56    var i, p, v, obj, args = MM_showHideLayers.arguments;
57    for (i = 0; i < (args.length - 2); i += 3)
58        with (document) if (getElementById && ((obj = getElementById(args[i])) != null)) {
59            v = args[i + 2];
60            if (obj.style) {
61                obj = obj.style;
62                v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v;
63            }
64            obj.visibility = v;
65        }
66}
67
68//隐藏显示层,加强版
69function MM_showHideLayers_pro() { //v9.0
70    var i, p, v, obj, args = MM_showHideLayers_pro.arguments;
71    for (i = 0; i < (args.length - 2); i += 3)
72        with (document) if (getElementById && ((obj = getElementById(args[i])) != null)) {
73            v = args[i + 2];
74            if (obj.style) {
75                obj = obj.style;
76                v = (v == 'show') ? 'block' : (v == 'hide') ? 'none' : v;
77            }
78            obj.display = v;
79        }
80}
81
82var currdatetime = MM_GetTime()
83//重新获取验证码
84function ReGetVerifyCode(myIMG) {
85    $.get('//kt.aiyinqing.com/web-generate/sys/randomImage/' + currdatetime, function (data) {
86        MM_findObj(myIMG).src = data.result
87    })
88}
89
90//更换控件的css样式
91function ChangeClassName(obj, classname) {
92    obj.className = classname;
93}
94
95//ASCII字符长度
96String.prototype.len = function () {
97    return this.replace(/[^x00-xff]/g, "**").length;
98}
99
100//去掉字符串头部和尾部的空格
101String.prototype.trim = function () {
102    //   用正则表达式将前后空格
103    //   用空字符串替代。
104    return this.replace(/(^\s*)|(\s*$)/g, "");
105}
106
107//截取字符串前面几个字符(按英文字节算、带省略号)
108String.prototype.sub = function (n) {
109    var r = /[^\x00-\xff]/g;
110    if (this.replace(r, "mm").length <= n) return this;
111    // n = n - 3;
112    var m = Math.floor(n / 2);
113    for (var i = m; i < this.length; i++) {
114        if (this.substr(0, i).replace(r, "mm").length >= n) {
115            return this.substr(0, i) + "...";
116        }
117    }
118    return this;
119};
120
121//获取时间
122function MM_GetTime() {
123    var d = new Date();
124    return d.getTime();
125}
126
127//判断浏览器
128var userAgent = navigator.userAgent, isIE = false;
129if (userAgent.indexOf('MSIE') != -1) {
130    isIE = true;
131}
132
133if (!isIE) { //firefox innerText define
134    HTMLElement.prototype.__defineGetter__("innerText",
135        function () {
136            var anyString = "";
137            var childS = this.childNodes;
138            for (var i = 0; i < childS.length; i++) {
139                if (childS[i].nodeType == 1)
140                    anyString += childS[i].tagName == "BR" ? '\n' : childS[i].innerText;
141                else if (childS[i].nodeType == 3)
142                    anyString += childS[i].nodeValue;
143            }
144            return anyString;
145        }
146    );
147    HTMLElement.prototype.__defineSetter__("innerText",
148        function (sText) {
149            this.textContent = sText;
150        }
151    );
152}
153
154//跳转地址
155function GotoPage(url, objName) {
156    obj = MM_findObj(objName);
157    url = url.replace("page=", "page=" + obj.value)
158    window.location.href = url;
159}
160
161//设置控件的HTML
162function SetControlHTML(obj, str) {
163    MM_findObj(obj).innerHTML = str;
164}
165
166//获取xmlhttp对象
167function GetXmlHttpRequest() {
168    var oBao;
169    if (window.XMLHttpRequest) {
170        oBao = new XMLHttpRequest();
171    } else if (window.ActiveXObject) {
172        oBao = new ActiveXObject("Microsoft.XMLHTTP");
173    } else {
174        alert("您的浏览器不支持XMLHTTP无刷新技术!");
175        return;
176    }
177    return oBao;
178}
179var dom;
180function load(myIMG,num){
181
182    if(num){
183        jQuery(myIMG).attr("disabled", true);
184    }else{
185        jQuery(myIMG).attr("disabled", false);
186    }
187
188
189}
190
191//发送留言
192function AddBook1(strSubject, strCompany, strEmail, strName, strTel, strMessage, sysOrgCode, tenantId,toname,webios,ip) {
193    try {
194        var  protocol = window.location.protocol
195        var href = window.location.host
196        var  href_url = protocol + "//" + href;
197        var url = window.location.href;
198        var list={
199            strSubject:strSubject,
200            strCompany:strCompany,
201            strEmail:strEmail,
202            strName:strName,
203            strTel:strTel,
204            strMessage:strMessage,
205            sysOrgCode:sysOrgCode,
206            tenantId:tenantId,
207            toname:toname,
208            webios:webios,
209            ip:ip,
210            url:url
211        }
212        window.sessionStorage.setItem("list" ,JSON.stringify(list))
213
214        $.ajax({
215            type: "POST",
216            url: "//kt.aiyinqing.com/web-generate/inquery/tblInquery/addTblInq",
217            contentType:"application/json",
218            data: JSON.stringify({
219                Action: 'AddBook1',
220                Subject: strSubject,
221                company: strCompany,
222                email: strEmail,
223                name: strName,
224                url: url,
225                telephone: strTel,
226                message: strMessage,
227                sysOrgCode: sysOrgCode,
228                tenantId: tenantId,
229                toname: toname,
230                webios:webios,
231                ip:ip
232            }),
233            success: function (ret) {
234                console.log(ret.message);
235                if(ret.message == "操作成功!"){
236                    window.location.replace(`${href_url}/transfer.html`)
237                    // load(".submitval",null)
238                    // location.reload();
239                }
240                else if(ret.message == "The verification code is incorrect"){
241
242                    window.location.replace(`${href_url}/VerificationCode.html`)
243                    ReGetVerifyCode('picCode');
244                }
245                else {
246                    alert(ret.message);
247                    load(".submitval",null)
248                    ReGetVerifyCode('picCode');
249                }
250            }
251        });
252    } catch (ex) {
253        load(".submitval",null)
254    }
255}
256
257
258function AddBook2(strSubject, strCompany, strEmail, strName, strTel, strMessage, sysOrgCode, tenantId,strCode,toname,webios,ip,url) {
259    try {
260        // var url = window.location.href;
261
262        $.ajax({
263            type: "POST",
264            url: "//kt.aiyinqing.com/web-generate/inquery/tblInquery/a
264dd?captcha=" + strCode + '&checkKey=' + currdatetime,
265            contentType:"application/json",
266            data: JSON.stringify({
267                Action: 'AddBook1',
268                Subject: strSubject,
269                company: strCompany,
270                email: strEmail,
271                name: strName,
272                url: url,
273                telephone: strTel,
274                message: strMessage,
275                sysOrgCode: sysOrgCode,
276                tenantId: tenantId,
277                toname: toname,
278                webios:webios,
279                ip:ip
280            }),
281
282            success: function (ret) {
283                console.log(ret.message);
284                if(ret.message == "操作成功!"){
285                    alert("The operation succeeded!");
286                    // window.open(url);
287                    load("#submitval",null)
288                    // openNewWindow(url)
289                    window.location.replace(`${url}`)
290                    // location.reload();
291                }
292                else {
293                    alert(ret.message)
294                    location.reload();
295                    ReGetVerifyCode('picCode');
296                }
297            }
298        });
299    } catch (ex) {
300        load("#submitval",null)
301    }
302}
303function  AddBook10(ip, tenantId, sysOrgCode, url,webios){
304    try {
305        $.ajax({
306            type: "POST",
307            url: "//kt.aiyinqing.com/web-generate/tblip/tblIp/add",
308            async: false,
309            contentType: "application/json",
310            data: JSON.stringify({
311                Action: 'AddBook10',
312                ip: ip,
313                tenantId : tenantId,
314                sysOrgCode : sysOrgCode,
315                url: url,
316                webios:webios
317            }),
318        });
319    }catch (ex) {
320    }
321}

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.