杂记
2016-06-10 18:03
246 查看
Ajax
$(function(){
queryApListForPage();
$("#addButton").click(function(){
queryAllApType();
});
$("#Add").blur(function(){
var apid=$("#Add").val();
$.ajax({
type:
"post",
url: getpath()+",,,,,.do",
data: {'apid':apid},
dataType:
"json",
contentType:
"application/x-www-form-urlencoded;charset=utf-8",
success: function(data){
if(data==false){
alert("xxx已存在,请重新填写")
/*$("#validMassage").html("xxx已存在,请重新填写");*/
}
}
});
Request
进度条:
提示框
对象中添加属性集合
$(function(){
queryApListForPage();
$("#addButton").click(function(){
queryAllApType();
});
$("#Add").blur(function(){
var apid=$("#Add").val();
$.ajax({
type:
"post",
url: getpath()+",,,,,.do",
data: {'apid':apid},
dataType:
"json",
contentType:
"application/x-www-form-urlencoded;charset=utf-8",
success: function(data){
if(data==false){
alert("xxx已存在,请重新填写")
/*$("#validMassage").html("xxx已存在,请重新填写");*/
}
}
});
<tr> <td class="tl">xxx权限配置:</td> <td class="tr"style= "padding:3px;border:2px solid #ddd;"> <divclass="divapList"style="overflow:scroll;height:200px;">[j1] <span class="apList"id="apList"></span> </div> </td> </tr> |
$.get[j2] (getpath()+"xxxx.do", function (data) { var ap =""; for(i=0;i<data.length;i++){ ap += "<input type='checkbox' name='1' value=" ap+=data[i].apid ap+=">" ap+=data[i].enName ap+="</input>" ap+="<br/>" } var aplist = document.getElementById("apList"); aplist.innerHTML = ap; }); |
publicvoid queryAplist(){ List queryAplist=sdkApprovalService.queryAplist(); writeJson(queryAplist); } |
Request
request.getSchema()可以返回当前页面使用的协议,http 或是 https; request.getServerName()可以返回当前页面所在的服务器的名字; request.getServerPort()可以返回当前页面所在的服务器使用的端口,就是80; request.getContextPath()可以返回当前页面所在的应用的名字; |
进度条:
<style> .processcontainer{width:450px;border:1px solid #6C9C2C;height:25px;} #processbar{background:#95CA0D;float:left;height:100%;text-align:center;line-height:150%; } </style> |
<tr> <div>导入进度 <divclass="processcontainer"> <div id="processbar"style="width:0%;"></div> </div> </div> </tr> |
var bartimer; function setewTime(){ bartimer = window.setInterval(function(){setewProcess();},100); } function setewProcess(){ $.ajax({ type: "POST", url: "xxxx.do", success: function(data){ var processbar = document.getElementById("processbar"); processbar.style.width = (data[1]/data[0])*100+"%"; processbar.innerHTML = data[1]+"/"+data[0]; if(processbar.style.width =="100%"){ window.clearInterval(bartimer); } } }); } |
提示框
var excel=$("#excelImport").val(); if(excel==""){ alert("上传文件必需选择!!"); return; }else{ var r=confirm("你确定吗?") if (r==true){ $form.attr("action","xxx.do"); $form.submit(); setewTime(); }else{ returnfalse; } |
对象中添加属性集合
wlan账号:<br><textareacols="30"rows="5"value="${apAccount.name }" id="select_name"name="apAccount.name"></textarea> |
class ApAccount private Stringname; /* 同时查询多个账号 */ public String[]getApAccountNames(){ if(Help.isNotEmpty(name)){ returnname.split("\\s+"); } returnnull; } |
<iftest="apAccountNames!=null"> and name i a14b n <foreach collection="apAccountNames"item="name"open="("separator=","close=")"> #{name} </foreach> </if> |
相关文章推荐
- Ajax
- $.ajax()方法详解
- jQuery ajax - ajax() 方法
- 使用Ajax实现异步用户名验证
- 使用ajax实现用户登录验证(升级版)
- Mootools 1.2教程 函数
- 解决Ajax悬停效果,无法遮蔽FLASH的问题
- autoit InputBox 函数
- 文件遍历排序函数
- 再谈Jquery Ajax方法传递到action(补充)
- Dom在ajax技术中的作用说明
- 关于C#中排序函数的总结
- AJAX实现瀑布流触发分页与分页触发瀑布流的方法
- Oracle 函数大全[字符串函数,数学函数,日期函数]第1/4页
- ASP下经常用的字符串等函数参考资料
- PostgreSQL教程(五):函数和操作符详解(1)
- DOS批处理 函数定义与用法
- asp Chr 函数 数字转字母的方法
- 使用Ajax实时检测"用户名、邮箱等"是否已经存在
- Lua中的函数精讲笔记