+ -
当前位置:首页 → 问答吧 → 登录邮箱功能!

登录邮箱功能!

时间:2011-08-01

来源:互联网

如何做到像hao123等网站那样,有一个登录各种邮箱的功能?有没有代码?给我参考一下。谢谢!

作者: cyyjm   发布时间: 2011-08-01

JScript code
var MailLogin = {
    mailCache: [],
    sendMail: function() {
        var B = G("hao_mail_username").value,
        D = G("hao_mail_passwd").value,
        F = G("hao_mail_options"),
        A = document.mail,
        _ = F.selectedIndex,
        I = Config.MailConfig[_],
        H = {
            u: B,
            p: D
        };
        if (I.val == 0) {
            alert("\u60a8\u6ca1\u6709\u9009\u62e9\u90ae\u7bb1\uff01");
            return
        }
        if (trim(H.u) == "") {
            alert("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01");
            return
        }
        if (trim(H.p) == "") {
            alert("\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01");
            return
        }
        if (this.mailCache.index != _) {
            this.mailCache.index = _;
            for (var J = 0, E = this.mailCache.length; J < E; J++) A.removeChild(this.mailCache[J]);
            this.mailCache = []
        }
        A.action = I.action;
        for (J in I.params) {
            var $ = Ci(J, format(I.params[J], H));
            this.mailCache.push($);
            A.appendChild($)
        }
        G("hao_mail_username").value = "";
        G("hao_mail_passwd").value = "";
        A.submit();
        G("hao_mail_username").value = B;
        var C = G("hao_mail_options").selectedIndex;
        UserTrack.send({
            level: "1",
            page: "index",
            type: "mail",
            index: C
        })
    },
    change: function(_) {
        var $ = Config.MailConfig[_.selectedIndex];
        if ($.type == "link") {
            UserTrack.send({
                level: "1",
                page: "index",
                type: "mail",
                index: _.selectedIndex
            });
            window.open($.action);
            _.selectedIndex = 13
        }
    }
}


你自己去分析一下里面的js,从这个对象里入手,我在hao123里面找出来的
http://www.hao123.com/js/main_201107261200.js

作者: aspwebchh   发布时间: 2011-08-01