码迷,mamicode.com
首页 > 其他好文 > 详细

添加人员以及查询人员信息

时间:2018-08-23 15:34:49      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:query   ToJson   100%   .json   mfa   response   ons   util   none   

<![CDATA[
function formsuc(data){
/*var rspJson = ClientUtil.stringToJson(data.responseText);*/
var rspJson = data.responseText;
$.showToast(rspJson);
}
function formfail(data){
$.showToast("请求失败,请检测网络");
}
]]>
</script>
<script type="text/javascript" src="res:script/exmobi_lite/core.js"></script>
</head>
<body>
<form id="user" name="user" method="post" action="http://add" success="formsuc" fail="formfail">
<font class="label-left">姓 名:</font>
<input class="label-right" type="text" name="name"></input>
<input type="hidden" name="type" value="1" ></input>
<hr/>

<font class="label-left">部 门:</font>
<input class="label-right" type="text" name="dartpartment"></input>
<hr/>

<font class="label-left">性 别:</font>
<!--<input class="label-right" type="text" name="sex"></input>-->
<select id="sid" class="label-right" name="sex" size="2">
<option value="0" >请选择</option>
<option value="男" >男</option>
<option value="女">女</option>
</select>

<hr/>

<font class="label-left">电 话:</font>
<input class="label-right" type="text" name="tel" validate="tel" validatemsg="电话号码格式不对"></input>
<hr/>
<input type="submit" value="添加" style="width:100%;margin:4 0;"/>
</form>
</body>

<%@ page language="java" import="java.util.*"
contentType="application/uixml+xml; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/client/adapt.jsp"%>
<%@ include file="/client/adapt_extend.jsp"%>

<%
String url="http://localhost:8080/test/user/add";
%>

<aa:http id="addUse" keepreqdata="true" method="get" url="<%=url %>"></aa:http>

<%
String rsp = aa.regex.regex(".*", "addUse");
System.out.println(rsp+"德玛西亚");
out.print(rsp);
%>

 

<![CDATA[
var timeid;

function getData(){
//if(timeid!=null){
//listtwoObj.remove();
//}
// listtwoObj.remove();
// clearTimeout(timeid);
$.server({
url:‘http://queryusers‘,
type:‘post‘,
dataType:‘json‘,
success:function(data){
/*var rsp=ClientUtil.jsonToString(data);*/
/*var rsp=ClientUtil.stringToJson(data);*/
var renderJson = {list:data};
$(‘#content‘).renderReplace(‘res:page/list.template‘,renderJson,function(h,t,o){});
},
error:function(data){

}
})
}

function rerash(){
/*clearTimeout(timeid);
var listtwoObj = document.getElementById("listtwoid");
if(listtwoObj!=null){
listtwoObj.remove();
}*/

//alert(listtwoObj);
getData();
document.getElementById("divload").style.display="none";
}
function testOnScrollBottom(){
document.getElementById("divload").style.display="block";
timeid = setTimeout("rerash()",1000);

}
]]>
</script>
</head>
<header>
<titlebar title="用户列表" iconhref="script:close" hidericon="true"/>
</header>
<body onload="getData();">
<page onScrollTop="testOnScrollBottom()">
<div id="divload" style="display:none;border-size:1;border-radius:4;height:50;border-color:#CCCCCC;background-color:rgb(247,247,247);text-align:center;text-valign:middle">

<img src="res:image/jiazai.png"/>

<font style="color:#cccccc">正在加载....</font>

</div>


<div style="" class="" id="content" href="">
<listitem type="twoline" caption="" rcaption="" id="listtwoid"></listitem>
</div>

</page>
</body>
</html>

 

<%@ page language="java" import="java.util.*"
contentType="application/uixml+xml; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/client/adapt.jsp"%>
<%@ include file="/client/adapt_extend.jsp"%>

<% String url="http://localhost:8080/test/user/queryUsers"; %>

<aa:http id="queryusers" keepreqdata="true" method="get" url="<%=url%>"></aa:http>

<% String rsp=aa.regex.regex(".*","queryusers");
System.out.println(rsp.toString());
out.print(rsp.toString());
%>

添加人员以及查询人员信息

标签:query   ToJson   100%   .json   mfa   response   ons   util   none   

原文地址:https://www.cnblogs.com/yuwan1993/p/9523639.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!