Passing parameters between HTML pages_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:49:14
Original
1235 people have browsed it

Pass the url parameters from page one to page two:

window.location.href="./page2.html?content="+encodeURI(encodeURI(userText))+"&name="+encodeURI(encodeURI(name));	
Copy after login

Page two gets the url parameters in s:

		var rf = document.referrer;		//获取url参数		function getQueryString(name) {			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");			var r = window.location.search.substr(1).match(reg);			if (r != null)				return unescape(r[2]);			return null;		}		var name = decodeURI(getQueryString('name'));		var content = decodeURI(getQueryString('content'));
Copy after login


My personal blog: http://blog.caicongyang.com;

My personal website: http://www.caicongyang.com;

My CSDN blog address:



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template