PageSourceSearch

http://www.010lvshi.cn/template/pc/default1/home/js/ask.js

js 010lvshi.cn collected 2026-10-09 04:31:10 UTC 3,824 bytes, 104 lines download raw bytes

1//此文件不允许修改
2is_amazeui = false;
3var MKAsk = {
4    url: {
5        ask_post: '/index.php?c=Ask&a=submit', //POST提交方式
6        ask: 'http://u.fl580.cn/index.php?s=/Ajax/ask&callback=?', //JSONP跨域提交方式
7        answer : '/index.php?s=/Ajax/answer'
8    },
9    ask: function(o, fn, is_post) { //切换站点
10        var post = false, url = this.ask;
11        if (!is_post) {
12            url = this.ask;
13        } else {
14            post = is_post ? true : false;
15        }
16        if (post || is_post) url = this.url.ask_post;
17        
18        var data = {};
19        data.content = jQuery(o).find('[name="content"]').val();
20        if (!data.content) {
21            fn({status:0, info:'\u54a8\u8be2\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a'});
22            return false;
23        }
24        data.contact = jQuery(o).find('[name="contact"]').val();
25        if (!data.contact) {
26            fn({status:0, info:'\u4e3a\u4e86\u5f8b\u5e08\u66f4\u597d\u7684\u89e3\u7b54\u60a8\u7684\u7591\u60d1\uff0c\u8bf7\u7559\u4e0b\u60a8\u7684\u624b\u673a\u53f7'});
27            return false;
28        }
29        if (!/^1[3|5|4|7|8][0-9]{9}$/.test(data.contact)) {
30            fn({status:0, info:'\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e'});
31            return false;
32        }
33        data.username = jQuery(o).find('[name="username"]').val();
34
35        //未跨域的情况可不传网站ID
36        try {
37            var wid = parseInt(jQuery(o).find('[name="wid"]').val());
38            if (wid > 0) {
39                data.wid = wid;
40            }
41        } catch (ex) { }
42        
43        //验证码可能不存在
44        var vcodeObj = jQuery(o).find('[name="vcode"]');
45        if (vcodeObj.length > 0) {
46            data.vcode = vcodeObj.val();
47            if (!/^[0-9A-Za-z]{4}$/.test(data.vcode)) {
48                fn({status:0, info:'\u9a8c\u8bc1\u7801\u683c\u5f0f\u4e0d\u6b63\u786e'});
49                return false;
50            }
51        }
52        data.vcode=vcodeObj.val();
53        MKAjax.get(url, data, function(rs) {
54            fn(rs);
55        }, post ? 'post' : null);
56        return false;
57    },
58    answer : function (qid, content, fn) { //回复问题
59        MKAjax.get(this.url.answer, {qid : qid, content : content}, function(rs) {
60            fn(rs);
61        }, 'post');
62        return false;
63    }
64};
65
66$(function() {
67    $("#qform").submit(function() {
68        return submitAsk(this);
69    });
70});
71
72var ask_status = false;
73//资料提交处理
74function submitAsk(o)
75{
76    if (ask_status) {
77        MKBox.alert('\u54a8\u8be2\u6b63\u5728\u63d0\u4ea4\u4e2d\uff0c\u8bf7\u7a0d\u7b49\u007e');
78        return false;
79    } else {
80        $(o).find("[name='submit']").val('\u6570\u636e\u63d0\u4ea4\u4e2d').attr('disabled', true);
81        ask_status = true;
82    }
83    try {
84        return mySubmitAsk(submitCallback, submitMethod ? true : false);
85    } catch (ex) {
86        $(o).find('input').attr('readonly', true);
87        MKAsk.ask(o, function(rs) {
88            ask_status = false;
89            $(o).find('input').removeAttr('readonly');
90            $(o).find("[name='submit']").val('\u63d0\u4ea4\u54a8\u8be2').removeAttr('disabled');
91            $(o).find('img').trigger('click');
92            if (rs.status === 1) {
93                var tip=$(o).attr('tip');
94                $(o).find('input,textarea').val('');
95                MKBox.alert(tip?tip:'\u60a8\u7684\u54a8\u8be2\u5df2\u7ecf\u6210\u529f\u63d0\u4ea4\u7ed9\u5f8b\u5e08\uff0c\u8bf7\u8010\u5fc3\u7b49\u5019\u5f8b\u5e08\u56de\u590d\u3002', '\u63d0\u793a', function(){
96                    location.href = '/ask/';
97                });
98            } else {
99                MKBox.alert(rs.info);
100            }
101        }, true);
102    }
103    return false;
104}

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.