Home > Web Front-end > JS Tutorial > Detailed explanation of the four forms of parameter passing_Basic knowledge

Detailed explanation of the four forms of parameter passing_Basic knowledge

WBOY
Release: 2016-05-16 15:49:40
Original
1411 people have browsed it

This article is summarized in daily work. The four forms of parameter transfer are shown below.

When to use GET, search, delete,

When to use POST, add, change (Special: use POST to log in, because the username and password cannot be displayed on the URL)

4 ways to get parameters

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
 <title></title> 
 <script type="text/javascript"> 
  function Go() { 
   window.location.href="localhost:21811/Handler1.ashx&#63;id=1&name='abc'" 
  } 
 </script> 
</head> 
<body> 
Copy after login


Copy code The code is as follows:

localhost:21811/Handler1.ashx?id=1&name="abc"




 

 <form action="Handler1.ashx" method="get"><!--注意action里面的连接不能带参数的-->> 
  <input type="text" name="id" value="3" /> 
  <input type="text" name="name" value="abc" /> 
  <input type="submit" value="通过传递参数" /> 
 </form> 
</body> 
</html> 
Copy after login

Through the introduction of the above code, I believe everyone will like it.

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