zoukankan      html  css  js  c++  java
  • 关于页面跳转带值问题

     a页面

    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <script src="js/jquery-3.0.0.min.js"></script>
        <script src="js/jquery.params.js"></script>
        <title>a页面</title>
        <script>
            $(function(){
                 name = $("#name").text();
                 age = $("#age").text();
                $("#btn").on("click",function(){
                   jump1();
                });
            });
            function jump1(){
                url = "b.html?name="+name+"&age="+age;//此处拼接内容
                window.location.href = url;
            }
        </script>
    </head>
    <body>
       <div id="name">tony</div>
       <div id="age">23</div>
       <button id="btn">跳转</button>
    </body>
    </html>

     跳转到b页面

    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <script src="js/jquery-3.0.0.min.js"></script>
        <script src="js/jquery.params.js"></script>
        <title>b页面</title>
        <script>
            $(function(){
               getData1();
            });
            function getData1(){
                var name = $.query.get("name");
                var age = $.query.get("age");
                $("#name").text(name);
                $("#age").text(age);
            }
        </script>
    </head>
    <body>
       <div id="name"></div>
       <div id="age"></div>
    </body>
    </html>

     vue 跳转页面带参数

    // 1.页面中的代码
    this.$router.push({
        name: 'generalAdminOrderFlowAdd',
        params: {
          type: 'add',
          templateType: this.orderTemplateType
         }
     })
     // 2.路由中的代码
     {
       path: ':type/:templateType',
       name: 'generalAdminOrderFlowAdd',
       component:   require('@/components/generalAdmin/order/orderFlow')
    }
    // 3.获取页面中的参数值
     let type = this.$route.params.type
  • 相关阅读:
    TOJ 5021: Exchange Puzzle
    Educational Codeforces Round 26
    2017 Multi-University Training Contest
    TOJ 5020: Palindromic Paths
    数论之 莫比乌斯函数
    TOJ 4475: The Coolest Sub-matrix
    Game on Tree
    python 线程
    python 管道、数据共享、进程池
    python 守护进程、同步锁、信号量、事件、进程通信Queue
  • 原文地址:https://www.cnblogs.com/llfy/p/9131644.html
Copyright © 2011-2022 走看看