Four forms of parameter passing-----URL, hyperlink, Js,form form

Source: Internet
Author: User

4 ways to get the parameters

<HTMLxmlns= "http://www.w3.org/1999/xhtml">  <Head>  <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>      <title></title>      <Scripttype= "Text/javascript">          functionGo () {window.location.href="localhost:21811/handler1.ashx?id=1&name= ' abc '"          }      </Script>  </Head>  <Body>       <!--//Several forms of parameter transfer -      <!--the 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 -      <ahref= "localhost:21811/handler1.ashx?id=1&name= ' abc '">Hyperlink pass-through parameters</a></Body>        <!--The Third kind: Through the JS method pass: The user clicks this button, triggers the onclick event, executes the Go () method, jumps to the Localhost:21811/handler1.ashx page, simultaneously passes the ID, and the name two parameters past  -      <inputtype= "button"onclick= "Go ()"value= "Pass parameters by JS method" />              <!--Fourth: Passing through form form forms -      <formAction= "Handler1.ashx"Method= "Get"><!--Note that the connection within the action cannot have parameters -><inputtype= "text"name= "id"value= "3" />          <inputtype= "text"name= "Name"value= "ABC" />          <inputtype= "Submit"value= "By passing parameters" />      </form>  </Body>  </HTML>  

Four forms of parameter passing-----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.