Small jquery Ajax app-mobile phone number attribution Query

Source: Internet
Author: User

To test whether jquery calls a third-party WebService, it uses jquery's $. Get (URL, Data, callback) to call a WebService that can be queried locally on a mobile phone.
PS: http://www.webxml.com.cn/zh_cn/index.aspx website provides a lot of useful simple WebService.
<HTML xmlns = "http://www.w3.org/1999/xhtml"> <br/> <pead> <br/> <title> jquery test </title> <br/> <MCE: script src = "http://code.jquery.com/jquery-1.4.3.js" mce_src = "http://code.jquery.com/jquery-1.4.3.js" Language = "JavaScript"> </MCE: SCRIPT> <br/> <MCE: script Type = "text/JavaScript" Language = "JavaScript"> <! -- <Br/> $ (document ). ready (function () {<br/> $ ("# btnget "). click (function () {<br/> var url = "http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/getMobileCodeInfo"; <br/> var mobile = $ ("# txtmobile "). val (); <br/> $. get (URL, {mobilecode: Mobile, userid: ""}, function (data) {<br/> var result = $ (data ). first (). text (); <br/> $ ("# divresponse "). text (result); <br/> }); </P> <p> // --> </MCE: SCRIPT> <br/> </pead> <br/> <body> <br/> <p> jquery mobile phone number attribution query </p> <br/> <div> <br/> mobilecode: <input id = "txtmobile" type = "text" style = "width: 100px "/> <br/> <input type =" button "id =" btnget "value =" get "style =" width: 80px "/> <br/> </div> <br/> <HR/> <br/> <Div id =" divresponse "> <br/> </div> <br/> </body> <br/> </ptml>
This service (http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx? OP = getmobilecodeinfo) requires two parameters: mobilecode and userid, which are assembled in JSON format. You can call http get. The procedure is simple and entertaining.
The running result is as follows:

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.