随笔分类 -  JavaScript

摘要://打印预览 window.print(); /*设置默认横向打印*/ @page { size: landscape; } /*设置默认纵向打印*/ @page { size: portrait; } 阅读全文
posted @ 2021-05-10 10:41 时光博客 阅读(234) 评论(0) 推荐(0)
摘要:<input type="file" name="dddd" id="imgs"> <input type="button" onclick="ck()" value="submit" /> var reader = new FileReader(); var AllowImgFileSize = 阅读全文
posted @ 2021-04-26 15:13 时光博客 阅读(107) 评论(0) 推荐(0)
摘要:<form id="form1"> <input type="text" value="1" name="Total" /> </form> //判断序列化表单是否包含空值 var data = $("#form").serialize(); var array = data.split("&"); 阅读全文
posted @ 2021-04-26 15:11 时光博客 阅读(174) 评论(0) 推荐(0)
摘要://数字转换中文大写 function toChinese(n) { if (n 0) return "零"; if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) return ""; var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = ""; n += 阅读全文
posted @ 2021-04-20 16:55 时光博客 阅读(702) 评论(0) 推荐(0)
摘要:<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=你的AK"></script> <div id="container" style="width: 100%;height:540px"></div> 阅读全文
posted @ 2020-06-11 09:30 时光博客 阅读(239) 评论(0) 推荐(0)
摘要:<input type="file"onchange="importf(this)" /> <p id="excelContent"></p> <script src="https://blog-static.cnblogs.com/files/zpblogs/xlsx.js"></script> 阅读全文
posted @ 2019-09-27 14:55 时光博客 阅读(488) 评论(0) 推荐(0)
摘要:<a href="javascript:;" id="export">导出</a> <script> $("#export").click(function () { var Title = [{ "value": "姓名" }, { "value": "课题组" }, { "value": "手机 阅读全文
posted @ 2019-09-05 16:19 时光博客 阅读(1371) 评论(0) 推荐(0)
摘要:<a href="javascript:;" id="export" >导出</a> <table> <thead> <tr> <th>姓名</th> <th>手机</th> </tr> </thead> <tbody id="tableExcel"> <tr> <td>扯淡1</td> <td>1 阅读全文
posted @ 2019-09-05 15:06 时光博客 阅读(2798) 评论(0) 推荐(1)
摘要:if (testId('320888888888888888') == false) { layer.msg("身份证号不正确!"); return false; } //身份证真实性验证 function testId(value) { var vcity = { 11: "北京", 12: "天 阅读全文
posted @ 2019-07-24 17:33 时光博客 阅读(1610) 评论(0) 推荐(0)
摘要://JS创建多个下载任务 function Down() { //文件名 var namearr = []; //文件路径 var hrefarr = []; $(".downs .col-md-4").each(function (index, item) { namearr.push(需要下载的 阅读全文
posted @ 2019-07-24 17:29 时光博客 阅读(724) 评论(0) 推荐(0)
摘要://传入动态水印内容 watermark({ watermark_txt: "扯淡" }); function watermark(settings) { //默认设置 var defaultSettings = { watermark_txt: "text", watermark_x: 20,// 阅读全文
posted @ 2019-07-24 15:09 时光博客 阅读(378) 评论(0) 推荐(0)
摘要:alert(getUuid()); function getUuid() { var len = 32;//32长度 var radix = 16;//16进制 var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst 阅读全文
posted @ 2019-07-23 18:29 时光博客 阅读(170) 评论(0) 推荐(0)
摘要:<div id="clock"></div> window.setInterval('showRealTime(clock)', 1000); function showRealTime(clock) { var d = new Date(); var year = d.getFullYear(); 阅读全文
posted @ 2019-07-23 18:08 时光博客 阅读(196) 评论(0) 推荐(0)
摘要:<div id="box">亲,准备好点名了吗?</div> <input type="button" value="开始点名" id="bt" onClick="doit()"/> var namelist = ["张三", "李四", "王五", "贺六", "孙九", "赵十", "刘一"]; 阅读全文
posted @ 2019-07-23 18:01 时光博客 阅读(264) 评论(0) 推荐(0)
摘要:<a href="javascript:;" onclick="copyText()">复制</a> <span id="text">222</span><input id="input"/> function copyText() { var text = document.getElementB 阅读全文
posted @ 2019-07-23 14:14 时光博客 阅读(171) 评论(0) 推荐(0)
摘要://刷新地方的ID,后面ID前必须加空格 $("#gwc").load(location.href + " #gwc"); 阅读全文
posted @ 2019-05-05 17:41 时光博客 阅读(5059) 评论(1) 推荐(2)
摘要:http://localhost:62683/youli/product.htm#0 alert(GetRequest()); //获取#号值 function GetRequest() { var str = location.href var num = str.indexOf("#"); st 阅读全文
posted @ 2019-01-29 11:17 时光博客 阅读(4306) 评论(0) 推荐(0)
摘要:<img src="http://img.zcool.cn/community/01c92f56597f686ac7251c94e76e51.jpg" /> <img src="http://img.zcool.cn/community/01888f5922bad7b5b3086ed4cc3711. 阅读全文
posted @ 2019-01-26 11:43 时光博客 阅读(4174) 评论(1) 推荐(1)
摘要:sessionStorage保存session 浏览器关闭自动清空 // 保存数据到sessionStorage sessionStorage.setItem('key', 'value'); // 从sessionStorage获取数据 var data = sessionStorage.getI 阅读全文
posted @ 2018-12-11 16:40 时光博客 阅读(6078) 评论(0) 推荐(0)
摘要:转载:https://blog.csdn.net/ghjzzhg/article/details/73607565 阅读全文
posted @ 2018-12-10 10:46 时光博客 阅读(563) 评论(0) 推荐(0)