Home >Web Front-end >JS Tutorial >Detailed explanation of the four forms of parameter passing_Basic knowledge
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?id=1&name='abc'" } </script> </head> <body>
f0e6b910d325453764a4833a972f53be
fd095329e0eeee109ebe401c2a0f230e
5f7fe65aae925ba0f20bcdd22ebe0965Hyperlink transfer parameters5db79b134e9f6b82c0b36e0489ee08ed36cc49f0c466276486e50c850b7e4956
684c5aa1a905bcf2d45cbf1cacd7da15
d764e2dfc3283d4fecccb664554ee603
c527c8576884e45cfcb290f0a2a835a0
<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>
Through the introduction of the above code, I believe everyone will like it.