随笔分类 - JS、JS_Jquery
1
jS操作
摘要:一、调出打印页面直接打印 //toolbar=no,location=no,directories=no,status=no 这些特征将分别隐藏工具栏、地址栏、目录按钮和状态栏。 window.open(routeData.href, 'newWindow', 'toolbar=no,locatio
阅读全文
摘要:<html> <head> <title>按钮点击事件示例</title> <script> function a(callback) { console.log("执行函数a!"); console.log("调用回调函数"); callback(); // 调用回调函数 } function b
阅读全文
摘要:一、 JSON.parse 妙用 用如下语句打印: console.info(result); console.info(result.data); console.info(JSON.parse(result.data)); console.info(JSON.parse(result.data)
阅读全文
摘要:/** * 身份证15位编码规则:dddddd yymmdd xx p * dddddd:地区码 * yymmdd: 出生年月日 * xx: 顺序类编码,无法确定 * p: 性别,奇数为男,偶数为女 * <p /> * 身份证18位编码规则:dddddd yyyymmdd xxx y * ddddd
阅读全文
摘要:一、【百度官网】https://lbsyun.baidu.com/ 开发文档:https://lbsyun.baidu.com/index.php?title=jspopularGL 二、百度地图使用例子 <html> <head> <meta http-equiv="Content-Type" c
阅读全文
摘要:function htmlEncode(value){ if (value) { return jQuery('').text(value).html(); } else { return ''; } } function htmlDecode(value) { if (value) { return $('')...
阅读全文
摘要:function CheckString(elId, spanId) { var str = document.getElementById(elId).value; var wck = document.getElementById(spanId); var ModelValue = docume
阅读全文
摘要:注意:对面页面要增加jquery引用。操作数值框,转大写,且转成带千位符的格式,labID为对应数值框后面的那个label的ID*/function NoToChinese(MyControl, labId) { //加千位符 var stmp = ""; if (MyContro...
阅读全文
摘要:验证含千位分隔符的数值:/^(\d{1,3}(,\d\d\d)*(\.\d+)?|\d+(\.\d+)?)$/.test(num)
阅读全文
摘要:function SetValue() { var strCodeName = $("#MainContent_ddlFullNameAndFullName").val(); if (strCodeName != "" && strCodeName.sp...
阅读全文
摘要:iframe刷新父页面parent.location.reload();iframe 一个子页面操作过后,刷新指定子页面parent.frames('ifrmname').location.reload()
阅读全文
摘要:是否显示 ' checked='' /> 是否可用 ...
阅读全文
摘要:window.onbeforeunload = function() { if(document.body.offsetWidth-50 document.body.clientWidth && event.clientY<0 ||event.altKey) { Close(); } }
阅读全文
摘要:index.asp代码 scrolling="auto" frameborder="NO" border="0" framespacing="0"> frame Right 中某个页面要访问其他frame的控件: va...
阅读全文
摘要:function funClear() { var txts = document.getElementsByTagName("input"); for (var i = 0; i < txts.length; i++) { if (txts[i].type == "text"||txts[i].type == "checkbox") { txts[i].value = ""; } } }
阅读全文
摘要:document.body.offsetWidth;document.getElementById("rightlst").style.width="100px"document.getElementById("rightlst").style.height="100px"
阅读全文
摘要:禁用整个页面用document.oncontextmenu=function(){return false;}禁用一个table用<tableoncontextmenu="returnfalse;"></table>
阅读全文
摘要:在javascript中验证日期的方法方法一:function checkDate(str) { var pattern = /^((\d{4})|(\d{2}))-(\d{1,2})-(\d{1,2})$/g; //校验格式,如果格式不匹配,返回 if(!pattern.test(str)) { alert("格式不匹配(YYYY-MM-DD 或 YY-MM-DD)!"); return false; } 注意:pattern.test(str)方法调用第一次为true第二次为false第三次为true……方法二/^((\d{4})|(\d{2}))[-./]...
阅读全文
1