Home  >  Article  >  Web Front-end  >  Solution to the problem of transferring values ​​between html pages

Solution to the problem of transferring values ​​between html pages

高洛峰
高洛峰Original
2017-03-06 15:19:451413browse

html pages can pass values ​​to each other. Have you ever heard of it? There is a good example below. You can refer to it. The first time I used Essay, I still felt quite awkward.
a.html

The code is as follows:

<html> 
<head> 
<title> demo </title> 
<meta name="Author" content="xugang" /> 
</head> 
<body> 
<FORM name="frm" METHOD="get" ACTION="b.html" onsubmit="return foo()"> 
<INPUT TYPE="hidden" id="hid" value="123" name="hid"> 
<INPUT TYPE="submit" value="提交"> 
</FORM> 
</body> 
</html>


b.html

The code is as follows: :

<HTML> 
<HEAD> 
<TITLE> New Document </TITLE> 
</HEAD> 
<BODY> 
<SCRIPT LANGUAGE="JavaScript"> 
document.write(location+"
"); 
document.write(location.search+"
"); 
document.write(decodeURIComponent(location.search.substr(location.search.indexOf("=")+1))); 
</SCRIPT> 
</BODY> 
</HTML>

For more related articles on solutions to the problem of transferring values ​​between html pages, please pay attention to the PHP Chinese website!

Statement:
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