


Detailed explanation of the four forms of parameter passing_Basic knowledge
May 16, 2016 pm 03:49 PMThis 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>
<!--//Several forms of parameter passing-->
<!--The first method: add parameters directly after the URL:-->
localhost:21811/Handler1.ashx?id=1&name="abc"
<!--Second: Use hyperlink method to pass parameters: When clicking the hyperlink, it will first jump to the localhost:21811/Handler1.ashx page, and then pass the two parameters id and name to the past - ->
<a href="localhost:21811/Handler1.ashx?id=1&name='abc'">Hyperlink transfer parameters</a></body>
<!--Third method: Passed through js method: The user clicks this button button, triggers the onClick event, executes the Go() method, jumps to the localhost:21811/Handler1.ashx page, and passes both the id and name at the same time Parameters passed-->
<input type="button" onclick="Go()" value="Pass parameters through js method" />
<!--The fourth method: passing through the form-->
<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.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Best practices for optimizing Golang function parameter passing performance

Detailed explanation of C++ function parameters: Performance optimization of parameter passing in parallel programming

Research on parameter passing methods in Go language

C++ function pointer parameter passing mechanism

golang function map passed as parameter

What is the parameter passing method for PHP functions?

The relationship between C++ function parameter passing methods and variable parameter functions

How to write a function with output parameters (called by reference) in Python?
