form of four parameter passes--url, hyperlink, Js,form form

Source: Internet
Author: User

When to use GET, check, delete

When to use post, add, change (Special column: Login with post, because the user name and password can not be displayed on the URL)

4 ways to get the parameters

functionGo () {window. location.href= "Localhost:21811/handler1.ashx?id=1&name= ' abc '"     }   </script> //several forms of parameter passing-- <!--First: Add parameters directly after the URL:--> localhost:21811/handler1.ashx?id=1&name= "abc" <!-- The second type: using hyperlinks to pass parameters: When you click on the hyperlink, the first jumps to the Localhost:21811/handler1.ashx page, and then passes the ID and name two parameters past---<a href= "localhost : 21811/handler1.ashx?id=1&name= ' abc ' > HYPERLINK transfer Parameters </a></body> <!--third: Pass the JS method: The user clicks the button, Trigger onclick event, execute Go () method, jump to Localhost:21811/handler1.ashx page, pass ID, and name two parameters past---<input type= "button" onclick = "Go ()" value= "pass the parameter by JS method"/> <!--Fourth: passed form form--<form action= "handler1.ashx" method= "Get" ><  !--Note that the connection within the action cannot have parameters of-->> <input type= "text" name= "id" value= "3"/> <input type= "text" name= "name" value= "abc"/> <input type= "Submit" value= "Pass parameters"/> </form></body> 

form of four parameter passes--url, hyperlink, Js,form form

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.