基于jiayouzl 的PHP快递单号跟踪类开发 的用法实例 自己添加了无刷新
供新手参考 大神勿喷!小弟谢过!
http://www.thinkphp.cn/extend/587.html
主要代码public function getExpress(){<br>
$num = I("num");<br>
$express = new \Org\Util\Express();<br>
$info = $express -> getorder($num);<br>
//dump($info);<br>
$nu = $info['nu'];<br>
$state = $info['state'];<br>
$data = $info['data'];<br>
$this->assign('nu',$nu);<br>
$this->assign('state',$state);<br>
$this->assign('data',$data);<br>
$this->display();<br>
}
ajax代码<script><br />
$(document).ready(function () {<br />
$("#form").submit(function(event){<br />
event.preventDefault();<br />
var $form = $(this),<br />
num = $form.find('input[name = "num"]').val(),<br />
url = $form.attr("action");<br />
$("#result").html("载入中。。。");<br />
$.post(url,{num:num},function(data){<br />
$("#result").empty().append(data);<br />
})<br />
<br />
});<br />
})<br />
</script>
express+ajax.zip ( 1.07 MB 下载:166 次 )
AD:真正免费,域名+虚机+企业邮箱=0元