87,910
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="js/cordova.js"></script>
<link rel="stylesheet" href="css/jquery.mobile-1.4.5.css"/>
<script src="js/jquery-1.11.2.js"></script>
<script src="js/jquery.mobile-1.4.5.js"></script>
<script type="text/javascript">
function clik(){
var cyid=$("#cyn").val();
$.ajax({ //调用ajax()函数,参数为选项object
traditional:true,
url: 'cyc_search.php', //url地址
type: 'POST', //HTTP请求的方法,这里是GET
dataType: 'json', //预期返回数据类型
data: {cyid:cyid}, //POST需要的数据
error: function(){ //当发生错误时候的回调
},
timeout: function(){//发生请求超时的回调
alert('time out');
},
success: function(data){//成功以后的回调,也就是readyStatus=4且status=200
var len=data.length;
$("#ulul").empty();
for(var i=0;i<len;i++){
var obj=data[i];
$("#ulul").append("<li><a href='cycs.php?id="+obj.userid+"'><img src='img/ppp.png'/><h3>编号: "+obj.userid+"</h3><p>用户名: "+obj.username+"</p></a></li>");
}
$("#ulul").listview("refresh")
}
});
}
</script>
</head>
<body>
<div data-role="page" name="cyc" id="cyc" align="center">
<div data-role="header" data-theme="b" data-position="fixed">
<a data-rel="back" data-icon="back">返回</a><h3>物流公司管理</h3></div>
<div data-role="content"><h3>查询结果</h3>
<table width="300px">
<tr><td width="150px"><input type="text" name="cyn" id="cyn" placeholder="物流公司编号" style="width:150px"/></td><td width="100px"><input type="button" value="提交" style="width:100px" data-theme="b" onClick="clik()"/></td></tr></table>
<ul data-role="listview" name="ulul" id="ulul" data-inset="true">
</ul>
</div>
</div>
</body>
</html>