The effect is as follows: a page After clicking the jump button The corresponding value can be obtained on page b. The code is as follows: a page: <!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 page</title> <script> $(function(){ name = $("#name").text(); age = $("#age").text(); $("#btn").on("click",function(){ jump1(); }); }); function jump1(){ url = "b.html?name="+name+"&age="+age;//Contents are concatenated here window.location.href = url; } </script> </head> <body> <div id="name">tony</div> <div id="age">23</div> <button id="btn">Jump</button> </body> </html> Page b to jump to: <!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>Page 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> The above is the problem of passing parameters in HTML page jump that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: Using CSS3 and JavaScript to develop web color picker example code
A MySQL custom value is a temporary container for...
Table of contents 1. Install node 2. Install Comm...
Table of contents 1. Implementation 2. Problems 3...
Table of contents 1. Preparation 2. Define the gl...
Preface Excel is powerful and widely used. With t...
Table of contents 2. Comma operator 3. JavaScript...
First, let me explain the version of MySQL: mysql...
Use HTML to write a dynamic web clock. The code i...
1. Clear floating method 1 Set the height of the ...
Table of contents 1. Software and system image 2....
Table of contents What is Vuex? Five properties o...
ARGB is a color mode, which is the RGB color mode...
This article example shares the specific code of ...
Lists are used to list a series of similar or rela...
MySQL download and installation (version 8.0.20) ...