
js
点点滴滴的岁月
成长之路,自强不息。
展开
-
js打开新的窗口
1.在原来的窗体中直接跳转用window.location.href="你所要跳转的页面";2、在新窗体中打开页面用:window.open('你所要跳转的页面');window.history.back(-1)//返回上一页3、一些用法按钮式:Go" onClick="location.href='连接地址'">链接式:go(-1)">返回上一页"原创 2017-07-18 08:33:49 · 347 阅读 · 0 评论 -
计算字节长度
function getByteLen(val) {var len = 0;for ( var i = 0; i var a = val.charAt(i);if (a.match(/[^\x00-\xff]/ig) != null) {len += 2;} else {len += 1;}}return len;}原创 2017-09-08 17:28:24 · 2026 阅读 · 0 评论 -
上传图片时button按钮隐藏,用做好的样式
jsp: 主题首页alt="" style="width: 100%; height: 100%; top: 0;" /> name="filepathsave" id="filepathsave" type="hidden"value="${subject.picUrl}" />multiple="multiple" style="opacity: 1"原创 2017-09-07 19:03:40 · 3300 阅读 · 0 评论 -
校验经纬度的格式是否符合规范
//校验经纬度的格式是否符合规范function verifylonglat(longitude,latitude){ //经度,整数部分为0-180小数部分为0到6位 var longreg = /^(\-|\+)?(((\d|[1-9]\d|1[0-7]\d|0{1,3})\.\d{0,6})|(\d|[1-9]\d|1[0-7]\d|0{1,3})|180\.0{0,6}|180原创 2017-09-05 14:50:40 · 13722 阅读 · 2 评论 -
电话号码校验
var regBox = { regMobile : /^0?1[3|4|5|8][0-9]\d{8}$/,//手机 regTel : /^0[\d]{2,3}-[\d]{7,8}$/ } var mflag = regBox.regMobile.test(restau_phone); var tflag = regBox.原创 2017-09-05 14:49:08 · 325 阅读 · 0 评论 -
标签显示问题
" filterable="false"> 8}">${fn:substring(item.name,0,8)}... ${item.name}原创 2017-08-04 10:06:19 · 272 阅读 · 0 评论 -
根据判断条件置灰按钮
if(rowData.status=='20'&&rowData.flowStatus=='1'){ var mod = '分配 | '; }else{ var mod = '分配 | '; }原创 2017-07-24 15:12:19 · 2829 阅读 · 0 评论 -
js操作select option
1、获取选中select的value和text,html代码如下:select id="mySelect">option value="1">one/option>option value="2">two/option>option value="3">three/option>/select>则可通过以下script代码s来获取选中的value和text$("原创 2017-07-24 09:59:14 · 450 阅读 · 0 评论 -
防止表单重复提交
$.ajax({ type:"POST", url:"${ctx}/sku/saveMultiSpe", data:{ specificationName:specificationName, classifyId:classifyId, ...原创 2018-02-27 19:07:06 · 182 阅读 · 0 评论