Implementation of jquery Ajax Local no refresh update data

Source: Internet
Author: User
Tags json

  This article mainly on the jquery Ajax local Refresh update data implementation cases are introduced, the need for friends can come to the reference, I hope to help you.

The page     code to be updated is as follows: <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head>     <title></title>       <script src= "js/jquery.js" type= "Text/javascript" ></script>   </head> <body >     <select id= "Lucky1" onchange= "return Duoduo ();" >         <option value= "1" > First phase </option>         <option value= " 2 "> Phase II </option>     </select>     <div id=" Duoduo ">         You Good </div>        <input type= "text" id= "duo"  /> </body>   <script type= "Text/javascript" >       function Duoduo () {      $.ajax ({      & nbsp     Type: ' Post ',//optional get             URL: ' ajax.aspx ',//Here is the program to receive data             data: ' Data= ' + $ ("#lucky1" ). Val (),//To PHP data, multiple parameters with & connections             dataType: ' HTML ',//server returned data type optional XML, JSON JSON P Script HTML text             Success:function (msg) {               //Here is the data processing function returned by the program after the successful AJAX submission. MSG is the returned data, and the data type is defined in the datatype parameter!                 document.getelementbyidx_x_x ("Duoduo") InnerHTML = msg;                //$ ("#duoduo") InnerHTML = msg;            ,             error:function () {    & nbsp           alert (' Sorry for failure ');             {       })    }   </script>   & lt;/html>     Operation page   code as follows:   Protected void Page_Load (object sender, EventArgs e)     {        if (request.params["Data"].t Ostring (). Equals ("1"))         {            Response.Write ("<a href=" Http://ww W.baidu.com "> First phase </a>");        }         ELSE if (request.params["data"). ToString (). Equals ("2"))         {            Response.Write ("<a href=" Http://ww W.baidu.com "> Phase 2nd </a>");        }    }  
Related Article

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.