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;。。。。。。。。

  • 相关阅读:
    ($children,$refs,$parent)的使用
    watch监听变化
    vue组件间通信六种方式(完整版)
    CSS水平垂直居中常见方法总结2
    CSS水平垂直居中常见方法总结
    Uncaught SyntaxError: Unexpected identifier 报错 import Vue from 'vue';
    前端跳槽面试必备
    防止重复发送Ajax请求问题
    JQuery中的$().each 以及 $.each的区别
    数组中的forEach和map的区别
  • 原文地址:https://www.cnblogs.com/nanxiaoxiang/p/2703615.html
Copyright © 2011-2022 走看看