Jquery Get method Cross-domain check Express Logistics Information __jquery

Source: Internet
Author: User

Summary of solutions seen online:

Html:

<p> Qualcomm Express Query </p>
			<label> Please enter a number:</label>
			<input type= "text" id= "TradeID" >
				<input id= "Querytrade" type= "button" value= "Submit" >
			<p> Qualcomm Express Logistics details </p>
			<table border= "1px" >
				<thead>
					<tr>
						<td> time </td>
						<td> Logistics information </td>
					</TR >
				</thead>
				
				<tbody>
				</tbody>
			</table>

Jquery:

$ (function () {
	$ ("#queryTrade"). Click (function () {
		$ ("tbody"). HTML ("")
		var TradeID = $ ("#tradeId"). Val (
		if (= = tradeid.length) {
			alert ($ ("#tradeId"). Val ())
			$.ajax ({
			  URL: "http://www.kuaidi100.com/ Query ",
			  type:" Get ",
			  dataType:" Jsonp ",//Most crucially, resolve Cross-domain issues
			  data:	{
					Postid:tradeid,
					type:" Zhongtong ",//other Express just change this string can be
					id:1,
					valicode:" ",
					Temp:" 0.7771608149632812 "
				},
			  success: function (data) {
					if ("= = Data.status) {
						var returninfo = Data.data for
						(var i = 0; i < Returninfo.leng Th i++) {
							//alert (returninfo[i].time)
							//alert (Returninfo[i].context)
							$ ("Tbody"). Append ("<tr> <td> "+returninfo[i].time+" </td> <td> "+returninfo[i].context+" </td></tr> ")
						}
					}else{
						Alert ("No logistics information.") ")
					}
				},
			  error:function () {
				alert (" Error "
				}}
			)
		}else{
			alert (" The length of the express number is 12 digits. ")
		}
	})
})


Reference articles:

Http://hlyblog.net/?p=86

http://gybmike.iteye.com/blog/1591845

The correct return format JSON
/**
* {"message": "OK", "state": "3″," "Data": [{The context]: "has been signed, the sign for the person is" I ",
* "Time": "2013-12-15 11:02:26", "Ftime": "2013-12-15 11:02:26"},{"context": "
* "Hunan Changsha Yuhua Branch" of the dispatch member "Lin da zi Zi Division 82177562 Telephone (82171562)" is sending a piece ",
* "Time": "2013-12-14 21:43:38", "Ftime": "2013-12-14 21:43:38"},{"The Context":
* "Courier has reached" Hunan Changsha Yuhua Branch "scanner is" Tang Jianmin "Last Stop Is" "," Time ":" 2013-12-14
* 17:19:52 "," Ftime ":" 2013-12-14 17:19:52 "},{" context ":" from "Hunan Changsha Aviation Ministry" sent to
* "Hunan Changsha Yuhua Branch" "," Time ":" 2013-12-14 16:26:36 "," Ftime ":" 2013-12-14 16:26:36 "}
*, {"context": "" "Zhejiang Xiaoshan Company" is carrying out "bag" scan "," Time ":" 2013-12-12 18:59:17 ",
* "Ftime": "2013-12-12 18:59:17"},{"context": "from" Zhejiang Xiaoshan Company "to" Hunan Changsha Transfer Department ""
*, "Time": "2013-12-12 18:59:17", "Ftime": "2013-12-12 18:59:17"},{"The Context": "Zhejiang Xiaoshan Company"
* "The company's 2013-12-12", "Time": "18:20:47", "Ftime": "2013-12-12 18:20:47"},
* {"Context": "" "" Zhejiang Xiaoshan Company "of the collection of" the company's Han Silk "has been received," time ":" 2013-12-12
* 14:56:21 "," Ftime ":" 2013-12-12 14:56:21 "}]," status ":" 200″, "com": "Shentong", "Nu":
* "768064369802″," condition ":" F00″, "Ischeck": "1″}"
*/
Bad Format JSON
/**
* {"status": "201″, Message": "Express Company parameter exception: No number does not exist or has expired"}
*/
/**
* @param string $postid Express number
* @param string $type Express type
* Shentong-> Shentong
* Ems-> EMS
* Shunfeng–> Shun Fung
* Yuantong–> Yuantong
* Zhongtong–>-Tong
* Yunda–> Yun da
* Tiantian-> Daily Express
* Huitongkuaidi–> Huitong Express
* Quanfengkuaidi–> Full Peak Express
* Debangwuliu–> Darbond Logistics
* Zhaijisong–> a rush to send
* @return Mixed JSON format
*/


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.