zoukankan      html  css  js  c++  java
  • 静态页面中嵌入动态页面

    1.在静态页面中

    <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) {//这里要用while
                    if ($('div')[index].attributes['type'] != undefined) {
                        $('div')[index].innerHTML += $.webpages($('div')[index].attributes);
                    }
                    index++;
                }
            })
        </script>

    <body>

    <div id="breadnav" type="GeBingName">
              //这里将是动态页面中的内容
            </div>

    </body>

    2.  jquery。cookie.js文件中的函数

    jQuery.webpages = function(list) {
        var text;
        try {
            if (list["type"] != undefined) {
                var type = list["type"].value;
                switch (type) {
                    case "login":
                        $.ajax({
                            type: "POST",
                            url: "/user/login",
                            async: false,
                            data: "value=" + window.location,
                            success: function(msg) {
                                text = msg;
                            }
                        });
                        break;。。。。。。。。

  • 相关阅读:
    CSS样式
    hdu 6038 Function
    hdu 6034 Balala Power!
    错排公式 (递推)
    快速求排列组合 lucas定理
    fzu Problem 2275 Game(kmp)
    HDU 3635 Dragon Balls(并查集)
    HDU 3172 Virtual Friends(map+并查集)
    hdu 2818 Building Block(并查集,有点点复杂)
    hdu 1272 小希的迷宫(并查集)
  • 原文地址:https://www.cnblogs.com/nanxiaoxiang/p/2703615.html
Copyright © 2011-2022 走看看