Ajax Learning Notes (3)--$.get () method

Source: Internet
Author: User

1 <Headrunat= "Server">2     <title>The $.get () method in jquery</title>3     <Scriptsrc= "Scripts/jquery-1.4.1.min.js"type= "Text/javascript"></Script>4     <Scripttype= "Text/javascript">5         $(function () {6             $("#send"). Click (function () {7 $.get (8             "get.aspx", //URL9 {username: $ ("#username"). Val (),Ten content: $ ("#content"). Val () One         }, //Data A              function(data, textstatus) { -                  $("#resText"). HTML (data); -  the              } //callback function -            ) -          }); -         });  +     </Script> - </Head> + <Body> A     <formID= "Form1"runat= "Server"style= "border:1px solid grey; width:300px;"> at     <Div> -         <P> -Comments:</P> -         <P> -Name:<inputtype= "text"name= "username"ID= "username" /></P> -         <P> inContent:<textareaname= "Content"ID= "Content"rows= "2"cols= " the"></textarea></P> -         <P> to             <inputtype= "button"ID= "Send"value= "Submit" /></P> +     </Div> -     <Divclass= "comment"> the comments already available: *         <DivID= "ResText"> $         </Div>Panax Notoginseng     </Div> -     </form> the </Body>
View Code
1  Public Partial class Get: System.Web.UI.Page2     {3         protected voidPage_Load (Objectsender, EventArgs e)4         {5             stringusername=request.querystring["username"];6             stringContent = request.querystring["content"];7 8             //format of the server return content: Html,xml,script,json,text, and _default9             //the HTML format is used hereTen             stringBackcontent ="<p> Name:"+username+"<br/> Content:"+content+"</p>"; One Response.Write (backcontent); A         } -}
View Code

:

Ajax Learning Notes (3)--$.get () method

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.