• jquery.cookie.js type


    //jquery.cookie.js
    
    jQuery.webpages = function(obj) {
        var text;
        var list = obj.attributes;
        try {
            if (list["type"] != undefined) {
                var type = list["type"].value;
    
                switch (type) {
                    case "login":
                        var msg;
                        var url = window.location;
                        if (document.referrer != undefined) {
                            url = document.referrer;
                        }
                        $.ajax({
                            type: "POST",
                            url: "/user/login",
                            async: true,
                            data: "value=" + url,
                            success: function(msg) {
                                obj.innerHTML = msg;
                            }
                        });
                                  break;
                }
            }
        }
        catch (e) { }
        return text;
    }

    下面是对cookie的引用

    //页面中

      <script type="text/javascript" language="javascript" src="/Scripts/jquery.cookie.js"></script>

        <script type="text/javascript" language="javascript">
            $(document).ready(function() {
                var index = 0;
                while (index < $('div').length) {
                    if ($('div')[index].attributes['type'] != undefined) {
                        $.webpages($('div')[index]);
                    }
                    index++;
                }
            })
        </script>

    <div class="notice_right" type="login">
            </div>

  • 相关阅读:
    事物的五种传播机制与七种传播行为
    Spring jdbcTemplate
    SpriingMVC执行流程结构
    SpringMVC视图解析器
    promise的基本使用和理解
    集合set的类型转换
    数据结构小结一
    Dotween的一些常用方法记录
    线程与进程的解释
    反射和特性
  • 原文地址:https://www.cnblogs.com/nanxiaoxiang/p/2725556.html
Copyright © 2020-2023  润新知