HTML page jump: window.open(url, "", "width=600,height=400"); The second parameter: _self, opens the window in the current window; _blank (default value), opens the new window in another new window; window.location.href="https://www.jb51.net"; //Open the window in the same current window window.history.back(-1); //Return to the previous page <a href="http://www.baidu.net" target="_blank"> HTML parameter passing: 1. URL parameter passing: The first page (a.html): var obj = a.value; // Pass to pop-up page parameter var url = 'jxb.html?obj='+obj; url = encodeURI(url); window.open(url, "", "width=600,height=400"); The second page (b.html): var url = decodeURI(window.location.href); var argsIndex = url .split("?obj="); var arg = argsIndex[1]; Note: For Chinese transmission: you can use encodeURI to encode the URL on page a and decodeURI to decode the URL on page b. 2. Cookie parameter transmission: function setCookie(cname,cvalue){ document.cookie = cname + "=" + cvalue; } function getCookie(cname){ var name = cname + "="; var ca = document.cookie; } 3. localStorage object parameter passing: a.html: var div = doucment.getElementById('DIV ID name to get the string'); localStorage.string = div.textContent; b.html: var div = doucment.getElementById('DIV ID name to be written'); div.textContent = localStorage.string; 4. window.opener() Parent page: <input type="text" name="textfield" id="textfield"/> window.open("subpage.html"); Subpages: window.opener.document.getElementByIdx('textfield').value='123123123'; Summarize The above is the editor's introduction to HTML page jump and parameter passing issues. I hope it will be helpful to everyone. 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! |
<<: The difference between absolute path and relative path in web page creation
>>: Implementation of new issues of CSS3 selectors
Development Background: Recently, I am working on...
When laying out the page, in order to give users ...
Table of contents Business Logic Data table struc...
Install the unzipped version of MySql database un...
Following are the quick commands to clear disk sp...
In order to make the table fill the screen (the re...
Preface Locks are synchronization mechanisms used...
Specific method: 1. Open Command Prompt 2. Enter ...
Install Nginx on Docker Nginx is a high-performan...
Let’s start the discussion from a common question...
1. MySQL 1.1 MySQL installation mysql-5.5.27-winx...
1. Enter the host machine of the docker container...
This article shares with you the specific method ...
Table of contents 1. Pull the image 2. Create a R...
The Flexbox layout module aims to provide a more ...