一下没有什么重要的,只是我平时积累的一些页面,紧急时或许会有用,相信过一段时间去东宇(公司分公司)了,这些资料页带不走,还不如留在博客里,趁组长级别们开会去了,他们已经开了一个点啦!我的组长去东宇查看环境去了,哈哈,想想就很美好!

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 [] array = new int[5];
int temp = 0 ;
for (int i = 0 ; i < array.Length - 1 ; i++)
{
for (int j = i + 1 ; j < array.Length ; j++)
{
if (array[j] < array[i])
{
temp = array[i] ;
array[i] = array[j] ;
array[j] = temp ;
}
}
 
js方法传参转义:var btn = '<i class="fa fa-remove" onclick="deleteRows(\''+value+'\');"></i>';
 
 2016年3月9日13:19:09
jsp界面返回小数类型转整数用el表达式的格式如下:

<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页面资料的更多相关文章

  1. 关于NPOI导入导出

    http://www.360doc.com/content/14/0110/16/432969_344152497.shtml NPOI汇入Excel仅支持2007版本以内: [HttpPost] p ...

  2. 沧海一声笑,移动应用的CRASH原因我找到! --记最新款数字化測试“星云測试“的使用攻略

    沧海一声笑,移动应用的CRASH原因我找到! --记最新款数字化測试"星云測试"的使用攻略 世界进步那么快,非常多新奇的点子层出不穷,于是我们创业.我们做最酷的手机应用,做最轰炸的 ...

  3. 【Alpha 冲刺】 1/12

    1. 任务明细及任务量 Alpha版本任务安排(非固化版本,视情况调整,若有遗漏,及时补充) 职务 姓名 预期负责的模块页面 模块页面/任务明细 难度系数(0~1)(根据UI/功能实现难度划分) 预计 ...

  4. spring boot(一):入门

    Spring Boot的优点 Spring Boot 是伴随着 Spring 4.0 诞生的,从字面理解,Boot是引导的意思,因此 Spring Boot 旨在帮助开发者快速搭建 Spring 框架 ...

  5. 08 SSM整合案例(企业权限管理系统):06.产品操作

    04.AdminLTE的基本介绍 05.SSM整合案例的基本介绍 06.产品操作 07.订单操作 08.用户操作 09.权限控制 10.权限关联与控制 11.AOP日志 06.产品操作 SSM 环境搭 ...

  6. Python快速建站系列-Part.Five.3-个人主页及资料页面

    |版权声明:本文为博主原创文章,未经博主允许不得转载. 第五部分最后一节,完成个人主页里资料页面的个人资料的展示和修改功能,不过毕竟功能比较少,个人资料其实只有昵称一项,手动滑稽. 一如既往先写出来u ...

  7. selenium之测试卫星资料页面操作(元素遍历)

    # 测试气象卫星资料页面功能 # author:gongxr # date:2017-07-24 import random, time from selenium import webdriver ...

  8. mxonline实战14,全局搜索,修改个人中心页面个人资料信息

    对应github地址:第14天   一. 全局搜索   1. 使用关键词搜索 courses/views.py/CourseListView新增代码,不用把search_keywords传到前端

  9. 输入URL到浏览器显示页面的过程,搜集各方面资料总结一下

    面试中经常会被问到这个问题吧,唉,我最开始被问到的时候也就能大概说一些流程.被问得多了,自己就想去找找这个问题的全面回答,于是乎搜了很多资料和网上的文章,根据那些文章写一个总结. 写得不好,或者有意见 ...

随机推荐

  1. CodeForces Round 199 Div2

    完了,这次做扯了,做的时候有点发烧,居然只做出来一道题,差点被绿. My submissions     # When Who Problem Lang Verdict Time Memory 443 ...

  2. JavaScript初学者应注意的七个细节

    每种语言都有它特别的地方,对于JavaScript来说,使用var就可以声明任意类型的变量,这门脚本语言看起来很简单,然而想要写出优雅的代码却是需要不断积累经验的.本文利列举了JavaScript初学 ...

  3. JavaScript事件流

    什么是JS事件流 早期的IE事件传播方向为由上至下,即从document逐级向下传播到目标元素:而Netscape公司的Netscape Navigator则是朝相反的方向传播, 也就是从目标元素开始 ...

  4. 【BZOJ】2178: 圆的面积并

    http://www.lydsy.com/JudgeOnline/problem.php?id=2178 题意:给出n<=1000个圆,求这些圆的面积并 #include <cstdio& ...

  5. NHibernate's inverse - what does it really mean?

    NHibernate's concept of 'inverse' in relationships is probably the most often discussed and misunder ...

  6. php pdo分页

    <table width="95%" border="1" cellspacing="0" cellpadding="0&q ...

  7. java中实现链表(转)

    分析: 上述节点具备如下特征: 1. 每个节点由两部分组成(存储信息的字段,存储指向下一个节点的指针) 2. 节点之间有着严格的先后顺序. 3. 单链表节点是一种非线性的结构,在内存中不连续分配空间. ...

  8. HDU 1069 Monkey and Banana(二维偏序LIS的应用)

    ---恢复内容开始--- Monkey and Banana Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  9. [ZZ] KlayGE 游戏引擎 之 Order Independent Transparency(OIT)

    转载请注明出处为KlayGE游戏引擎,本文的永久链接为http://www.klayge.org/?p=2233 http://dogasshole.iteye.com/blog/1429665 ht ...

  10. error while loading shared libraries: xxx.so.x" 错误的原因和解决办法

    今天在执行一个protobuf程序时,提示error while loading shared libraries: libprotobuf.so.8: cannot open shared obje ...