Home > php教程 > php手册 > 新手,跨域查询订单

新手,跨域查询订单

WBOY
Release: 2016-06-07 11:37:06
Original
1058 people have browsed it

通过接口实现
<meta> <br> <input>2015br/><br><br><br> <input>订单号<br><br> <input><br> <div> <br> <table> <br>     <tr> <br>         <td>订单号</td> <br>         <td>派送方式</td> <br>         <td>派送时间</td> <br>         <td></td> <br>     </tr> <br>     <tr> <br>         <td><span></span></td> <br>         <td><span></span></td> <br>         <td><span></span></td> <br>         <td><span></span></td> <br>     </tr> <br> </table> <br> </div> <br> <div></div> <br> <br> <br> <script></script><br> <script><br /> function a(){<br /> var much = $("#much").val();<br /> $.ajax({<br /> url:"http://www.myhtml.com/a.php?id="+much,<br /> type:&#039;GET&#039;,<br /> dataType:&#039;jsonp&#039;,<br /> jsonpCallback:&#039;show&#039;,<br /> success:function(a){<br /> //alert(a.much)<br /> if(a.much == undefined){<br /> $("#muc").html(a.error)<br /> }else{<br /> $("#muc").html(a.much);<br /> $("#type").html(a.type);<br /> $("#tim").html(a.tim);<br /> }<br /> }<br /> })<br /> }<br /> <br /> function b(){<br /> //alert("123")<br /> var much = $("#much").val();<br /> //alert(much)<br /> $.ajax({<br /> url:"http://www.myhtml.com/b.php?id="+much,<br /> type:&#039;GET&#039;,<br /> dataType:&#039;jsonp&#039;,<br /> jsonpCallback:&#039;show&#039;,<br /> success:function(a){<br /> $("#goodsname").html(a.goodsname);<br /> }<br /> })<br /> }<br /> <br /> function fun5(page){<br /> $.ajax({<br /> url:"http://www.myhtml.com/c.php?id="+2015+"&page="+page+"&num="+3,<br /> type:&#039;GET&#039;,<br /> dataType:&#039;jsonp&#039;,<br /> jsonpCallback:&#039;show&#039;,<br /> success:function(a){<br /> var op = "";<br /> $.each(a,function(index,val){ // 解析出data对应的Object数组 <br /> //alert()<br /> op+="<li>订单号:"+val.much+"  派送方法:"+val.type+"  派送时间:"+val.tim+"";<br /> });<br /> op = "<ul>"+op+"";<br /> $("#show").html(op)<br /> <br /> }<br /> })<br /> var page = "<a href=&#039;javascript:void(0)&#039; onclick=&#039;fun5("+(page-1)+")&#039;>上一页  <a href=&#039;javascript:void(0)&#039; onclick=&#039;fun5("+(page+1)+")&#039;>下一页";<br /> $("#page").html(page);<br /> }<br /> <br /> </script> 

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template