PageSourceSearch

https://aosong.com/Res/js/ajax/whir.ajax.js

js aosong.com collected 2026-10-03 23:09:52 UTC 1,831 bytes, 57 lines download raw bytes

1//--------------------------------------------------------------------------------
2// 文件描述:整站Ajax请求封装
3// 文件作者:张清山
4// 创建日期:2013-12-10 15:09:32
5// 修改记录:
6//--------------------------------------------------------------------------------
7
8//调用代码示例:
9//$.whir.ajax('UserHandler.AddMember', {
10//    params: {
11//        username: userName
12//    },
13//    success: function (response) {
14//        var result = eval(response)[0];
15//        if (Boolean(result.status)) {
16//            alert(result.body);
17//        }
18//    },
19//    err: function (msg) {
20//        alert("异常:" + msg);
21//    }
22//});
23
24//网站根目录
25var rootpath = location.protocol + "//" + location.hostname + (location.port == 80 ? "" : ":" + location.port) + "/";
26$.whir = $.whir || { version: '1.0' };
27$.extend($.whir, {
28    htmlEncode: function (text) {
29        var span = $('<span>');
30        span.html(text);
31        return span.html();
32    },
33    ajax: function (cmdName, params) {
34        if (typeof (cmdName) != 'string' || cmdName == 'undefind')
35            return;
36        var defaultParms = {
37            url: rootpath + "ajax.aspx",
38            data: '',
39            type: 'POST',
40            params: {}
41        };
42        var getXml = function (setting) {
43            var xml = '';
44            for (var arg in setting.params) {
45                xml += ('<' + arg + '>' + $.whir.htmlEncode(setting.params[arg]) + '</' + arg + '>');
46            }
47            return xml;
48        };
49        var settings = $.extend(defaultParms, params);
50        var data = '<root><_type>' + cmdName + '</_type>';
51        data += getXml(settings);
52        data += '</root>';
53        settings.data = data;
54        $.ajax(settings);
55    } 
56});
57

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.