一些html页面资料
一下没有什么重要的,只是我平时积累的一些页面,紧急时或许会有用,相信过一段时间去东宇(公司分公司)了,这些资料页带不走,还不如留在博客里,趁组长级别们开会去了,他们已经开了一个点啦!我的组长去东宇查看环境去了,哈哈,想想就很美好!
html单选按钮取值:
html:<input type="radio" id="transition"name="pass" value="iscontinue" style="display: none;" class="radio5"/><span style="display: none;" id="sp" >继续贷前审核</span>
<input type="radio" id="transition_reject" name="pass" value="true" checked="checked" class="radio5"/><span id="sp">通过 </span>
<input type="radio" id="transition_reject"name="pass" value="false" class="radio5"/><span id="sp" >不通过</span>
js取值:$("input[name='pass']").each(function() {
if ($(this).is(':checked')) {
if( $(this).val()!="true"){
alert();
}else{
alert();
}
}
});
mybatis:
sql语句循环遍历:
<if test="idList !=null">
<foreach collection="idList" index="index" item="mcs_cre_credit_head_id" open="(" separator="," close=")">
#{mcs_cre_credit_head_id}
</foreach>
</if>
java后台获取时间:格式如:2014-09-29 14:51:21.697
Timestamp sysTime = new Timestamp(System.currentTimeMillis());//获取当前时间
js:分割数据:
str.replace(/\n/g, " ");//替换全部回车或者换行/g是全局的意思
邮箱校验:/^[\.a-zA-Z0-9_-]{4,16}@[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/
用户名由6~20位字母、数字、下划线组成,以字母开头:/^[a-zA-Z][a-zA-Z0-9_]{5,19}$/
密码:/^[\u4e00-\u9fa5]+$/
空格:/\s/
中文版的姓名:/^[\u4E00-\u9FA5]+$/
手机号码:/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
整数: /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/
小数:/^[0-9]+([.][0-9]{1,2}){0,2}$/
保留小数后两位:/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/
js创建时间对象:
var now=newDate();//创建时间对象
var year=now.getFullYear();//年
var month=now.getMonth();//月
var date=now.getDate();//日
var day=now.getDay();//星期几
var hour=now.getHours();小时
var minu=now.getMinutes();
var sec=now.getSeconds();
if(confirm("您的余额不足,请充值!")){
location.href = "/resources/html/fundmanage/fundmanage.html";
}
return;
清空form表单input 值:
<form id="searchForm" onsubmit="return false;">
<input id="mortgagee_name" name="mortgagee_name" type="text" />
</form>
js:
$('#searchForm').form('reset');
util.openWindow('editWindow', global_param.context_name+"/corporate/"+node.credit_id+'/openborrowerwind');
@RequestMapping(value="{credit_id}/openborrowerwind",method=RequestMethod.GET)
public String openBorrowerWind(HttpServletRequest request,@PathVariable("credit_id") Integer credit_id,Model model){
if (SysUtil.hasRight(request, "openborrower", GlobalVal.MENU_FUNCTION.VIEW)) {
// corporateService.getBorrowerInfo(request, applyVo)
model.addAttribute("credit_id", credit_id);
SysUtil.getToken(request);
return "/corporate/repaymentEdit.jsp";
}else{
return GlobalVal.STATIC_MENU.NO_RIGHT_PAGE;
}
}
int temp = 0 ;
for (int i = 0 ; i < array.Length - 1 ; i++)
{
1_447H.png)
for (int j = i + 1 ; j < array.Length ; j++)
{
if (array[j] < array[i])
{
temp = array[i] ;
array[i] = array[j] ;
array[j] = temp ;
}
}
}
<td>
<c:choose>
<c:when test="${item.zylx eq 1}">
<fmt:parseNumber integerOnly="true" value="${item.hqsl }" />
</c:when>
<c:otherwise>${item.hqsl }</c:otherwise>
</c:choose>
</td>
同事说,<fmt标签还有很多属性,多需查看。
json封装:
public Resolution changeProduct(){
Shopgoodsprductys result=shopgoodsprductysService.getysbycode(getProduct());
String str="{";
if(result!=null){
str+="prod_code:'"+result.getSuppliercode()+"',";
str+="product_name:'"+result.getProductname()+"',";
str+="fixed_price:'"+result.getYscpcbj()+"',";
str+="startdate:'"+result.getEffectivetime()+"',";
str+="enddate:'"+result.getInvalidtime()+"',";
str+="prod_category:'"+result.getProducttype()+"'";
}
str+="}";
JSONObject json=JSONObject.fromObject(str);
return new StreamingResolution("text", new StringReader(json.toString()));
}
function changeSuppliercode(){
var product = $("input[name='shopgoodsprductys.suppliercode']").val().trim();
var url=getbasePathUrl('zxxt/Shopgoodsprductys.action?changeProduct=');//url路径
if(product!=null && typeof(product)!='undefined'&&product!=""){
$.get(url,{product:product},function(data){
var ob = eval("("+data+")");
$("input[name='shopgoodsprductys.productname']").val(nullToStr(ob.product_name));//产品名称
$("input[name='shopgoodsprductys.yscpcbj']").val(nullToStr(ob.fixed_price));//原始产品成本价
$("input[name='shopgoodsprductys.effectivetime']").val(nullToStr(ob.startdate));//有效期起
$("input[name='shopgoodsprductys.invalidtime']").val(nullToStr(ob.enddate));//有效期止
var type = nullToStr(ob.prod_category);
showSelected(type);
});
}
}
function showSelected(obj){
console.log("obj:"+obj);
if(obj!=null && typeof(obj)!='undefined'&&obj!=""){
var value = document.getElementById("DeviceType").options;
for(var i=0;i<value.length;i++){
if(value[i].value==obj){
document.getElementById('DeviceType').options[i].selected=true;
}
}
}
}
js包含某个字段并替换掉:
数据格式如下:
<pic>http://img.com/cqlt-pms/Index/01.jsp</pic>
替换操作:
var pi= new RegExp("<pic>","g");
var pi2= new RegExp("</pic>","g");
contents = contents.replace(pi, "<p><img class='pics input_item' alt='' src='");
contents = contents.replace(pi2, "' width='180px' height='120px'/><input type='button' class='delthis' value='删除' onclick='delthist(this)'/></p>");
$("#takesthis").html(contents);
将生成html:
<img class="pics input_item" alt="" src="http://img.com/cqlt-pms/Index/01.jsp" width="180px" height="120px" /><input type="button" class="delthis" value="删除" onclick="delthist(this)"/>
//开始日期不能大于结束日期
function checkTime(){
var tim = true;
var startdate=$("input[name='shophqyfjfpz.yxkssj']").val();
var enddate=$("input[name='shophqyfjfpz.yxjssj']").val();
var begin=new Date(startdate.replace(/-/g,"/"));
var end=new Date(enddate.replace(/-/g,"/"));
if(begin>end){
var htmlmsg = '<small class="validate-msg"><span style="color: #FF0000;">时间大小错误</span></small>';
$("input[name='shophqyfjfpz.yxjssj']").next("small.validate-msg").remove();
$("input[name='shophqyfjfpz.yxjssj']").after(htmlmsg);
tim = false;
}else{
$("input[name='shophqyfjfpz.yxkssjs']").next("small.validate-msg").remove();
tim=true;
}
return tim;
}
得到的日期格式如下:2016-04-28 10:03:04
mysql查询重复的数据:select user_name,count(*) as count from user_table group by user_name having count>1;
整数正则表达式:/^[1-9]+[0-9]*$/
正整数正则表达式:var reg = /^[0-9]\d*$/;
保留两位小数的正则表达式:/^[0-9]+([.][0-9]{1,2}){0,2}$/
var pram = $("#contentMain tr").map(function(i,e){
if(i != "0"){
var obj = {
"phone":$(this).find("td").eq(1).text(),
"content":$(this).find("td").eq(2).text()
}
}
return obj;
}).get();
正则表达式既能验证手机和座机:/^(010\d{8})|(0[2-9]\d{9})|(0\d{2,3}-\d{7,8})|(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
jq以什么开头:
$(".coupon-f [class^=radio-pic]").removeClass("radio-pic-on");//class为coupon-f下的以radio-pic开头的class元素。
^= 以什么开头
$= 以什么结尾
~= 包含什么
当input=number时,设置maxlength无效可以酱紫做,可解决:
<input type="number" oninput="if(value.length>3)value=value.slice(0,3)" value="1" minValue="1" /> //最大长度为3
阻止form表单提交:
<form onsubmit="return false;"></form>
暂且写到这里吧,同事下楼出去吹吹风,我也出去一趟,换换心情,今天一个朋友离职了,心情贼啦贼啦不好!
一些html页面资料的更多相关文章
- 关于NPOI导入导出
http://www.360doc.com/content/14/0110/16/432969_344152497.shtml NPOI汇入Excel仅支持2007版本以内: [HttpPost] p ...
- 沧海一声笑,移动应用的CRASH原因我找到! --记最新款数字化測试“星云測试“的使用攻略
沧海一声笑,移动应用的CRASH原因我找到! --记最新款数字化測试"星云測试"的使用攻略 世界进步那么快,非常多新奇的点子层出不穷,于是我们创业.我们做最酷的手机应用,做最轰炸的 ...
- 【Alpha 冲刺】 1/12
1. 任务明细及任务量 Alpha版本任务安排(非固化版本,视情况调整,若有遗漏,及时补充) 职务 姓名 预期负责的模块页面 模块页面/任务明细 难度系数(0~1)(根据UI/功能实现难度划分) 预计 ...
- spring boot(一):入门
Spring Boot的优点 Spring Boot 是伴随着 Spring 4.0 诞生的,从字面理解,Boot是引导的意思,因此 Spring Boot 旨在帮助开发者快速搭建 Spring 框架 ...
- 08 SSM整合案例(企业权限管理系统):06.产品操作
04.AdminLTE的基本介绍 05.SSM整合案例的基本介绍 06.产品操作 07.订单操作 08.用户操作 09.权限控制 10.权限关联与控制 11.AOP日志 06.产品操作 SSM 环境搭 ...
- Python快速建站系列-Part.Five.3-个人主页及资料页面
|版权声明:本文为博主原创文章,未经博主允许不得转载. 第五部分最后一节,完成个人主页里资料页面的个人资料的展示和修改功能,不过毕竟功能比较少,个人资料其实只有昵称一项,手动滑稽. 一如既往先写出来u ...
- selenium之测试卫星资料页面操作(元素遍历)
# 测试气象卫星资料页面功能 # author:gongxr # date:2017-07-24 import random, time from selenium import webdriver ...
- mxonline实战14,全局搜索,修改个人中心页面个人资料信息
对应github地址:第14天 一. 全局搜索 1. 使用关键词搜索 courses/views.py/CourseListView新增代码,不用把search_keywords传到前端
- 输入URL到浏览器显示页面的过程,搜集各方面资料总结一下
面试中经常会被问到这个问题吧,唉,我最开始被问到的时候也就能大概说一些流程.被问得多了,自己就想去找找这个问题的全面回答,于是乎搜了很多资料和网上的文章,根据那些文章写一个总结. 写得不好,或者有意见 ...
随机推荐
- BZOJ3322 : [Scoi2013]摩托车交易
求出最大生成树,则两点间的最大容量为树上两点间的边权的最小值. 设$lim[i]$表示第$i$个订单的城市允许携带的黄金上限,则 $lim[i]=\min(lim[i+1],a[i]和a[i+1]点间 ...
- POJ 1947 (树形DP+背包)
题目链接: http://poj.org/problem?id=1947 题目大意:树中各点都由一条边连接.问要弄出个含有m个点的(子)树,至少需要截去多少条边. 解题思路: 设dp[i][j]为i总 ...
- 20145325张梓靖 实验五 "JAVA的网络编程"
20145325张梓靖 实验五 "JAVA的网络编程" 实验内容 使用 JVAV语言 进行网络编程 对明文进行加密 设计过程 我完成的是客户端,服务端同伴 20145308刘昊阳 ...
- topcoder SRM 591 DIV2 TheArithmeticProgression
#include <iostream> #include <cstdlib> using namespace std; class TheArithmeticProgressi ...
- TYVJ P1029 牛棚回声 Label:坑
背景 USACO OCT09 3RD 描述 奶牛们灰常享受在牛栏中牟叫,因為她们可以听到她们牟声的回音.虽然有时候并不能完全听到完整的回音.Bessie曾经是一个出色的秘书,所以她精确地纪录了所有的牟 ...
- 【BZOJ】1192: [HNOI2006]鬼谷子的钱袋(水题)
http://www.lydsy.com/JudgeOnline/problem.php?id=1192 看到题我就好像想起以前小学升学考数学的最后一题,将一条金块分割最少的部分,使得每一天都能够支付 ...
- thinkphp中M()和D()的理解
在tp框架中基于MVC设计模式中的model文件夹下,处理数据时会创建和表相关的模型类文件.在控制器中需要使用时需要实例化模型类对象,写语句 1.$a = new GoodsModel(); 这是基于 ...
- 在Excel中实现查询功能
$sn = Read-Host -Prompt "请输入员工号|序列号|资产号" $xl = New-Object -ComObject "Excel.Applicati ...
- 【iCore、iCore2、iBoard例程】【异步FIFO跨时钟域通信(通过ARM 读FPGA FIFO)】
欢迎访问电子工程师学堂,以便了解更多内容:http://www.eeschool.org 一.本实验基于iCore2 完成,通过简单改动,即可用在 iCore 核心板.iBoard 电子学堂上. iC ...
- 分布式架构高可用架构篇_02_activemq高可用集群(zookeeper+leveldb)安装、配置、高可用测试
参考: 龙果学院http://www.roncoo.com/share.html?hamc=hLPG8QsaaWVOl2Z76wpJHp3JBbZZF%2Bywm5vEfPp9LbLkAjAnB%2B ...