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

新手,跨域查询订单

WBOY
WBOY原創
2016-06-07 11:37:061055瀏覽

通过接口实现
<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元

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn