C # AJAX Click on the text box, get data from the background display drop-down list (with skin)

Source: Internet
Author: User
<script src= "Js/jquery-1.4.2.js" ></script>
    <script src= "Js/jquery.ui.core.js" ></script>
    <script src= "Js/jquery.ui.position.js" ></ script>
    <script src= "js/jquery.ui.widget.js" ></script>
    <script src= "js/ Jquery.ui.autocomplete.js "></script>
    <link href=" Themes/excite-bike/jquery-ui-1.9.0.custom.css " rel= "stylesheet"/>
    <script type= "Text/javascript" >
The accompanying resource bundle, please go to my resources page to download.
                    Please note that the ashx file is to be placed in the Jquerycomplete directory//import order as the same as the article $ (document). Ready (function () {$.ajax (
                        {type: ' post ', url: ' Keyvaluehandler.ashx ', DataType: "Text", success:function (data) {Parray = $.parsejs
                        On (data);
                                }, Complete:function () {$ ("#txtCitys"). AutoComplete ({
                                    Source:parray, Select:function (event, UI) {
                                    $ ("#txtCitys"). Val (Ui.item.value);
                                    $ ("#txtCitys"). Val (Ui.item.label);
                                Event.preventdefault ();
                            }
                            }); $ ("#txtCitys"). Data ("AutoComplete"). _renderitem = function (uL, Item) {return $ ("<li></li>"). Data ("ITEM.A Utocomplete ", Item). Append (" <a><table style= ' width:300; ") > <tr> <td align= ' left ' > ' + Item.label + ' </td> <td align= ' right ' style= ' Color:green '
                            > "+ item.value + </td> </tr> </table></a>"). APPENDTO (UL);
                        };
        }


                    });


    }); </script> <body> <input type= "text" id= "Txtcitys"/> </body>

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.