
javascript
一念永恒
这个作者很懒,什么都没留下…
展开
-
javascript 将table导出 Excel ,可跨行跨列
原文地址:https://www.cnblogs.com/hailexuexi/p/10795887.html<script language="JavaScript" type="text/javascript"> //jQuery HTML导出Excel文件(兼容IE及所有浏览器) function HtmlExportToExcel(table...转载 2019-11-25 18:20:38 · 960 阅读 · 1 评论 -
ztree改变节点颜色
//找到节点对象var node = ztree.getNodesByParam("id",'aaaaaaaaaabbbbbb', null)[0];if(node!=null){ //找到span标签,并改变颜色 $("#"+node.tId+"_span").css("color",'red');}原创 2019-08-05 16:11:16 · 5652 阅读 · 0 评论 -
Javascript报错Failed to execute ‘querySelectorAll‘ on ‘Document‘: ‘#123456‘ is not a valid sele
Javascript报错:Failed to execute ‘querySelectorAll’ on ‘Document’: ‘#123456’ is not a valid selector解决方式(除开特殊符号,第一个字符必须是字母):第一种:将ID前面加字母,例如:document.querySelectorAll('#id123456')第二种:根据ID属性,例如:docum...原创 2018-12-19 14:34:16 · 33691 阅读 · 5 评论 -
JS重写Alert方法
var _alert =window.alert;window.alert = function(){console.log(arguments);_alert(arguments);}转载 2018-11-01 16:15:43 · 1790 阅读 · 0 评论 -
JS生成随机ID
function generateUUID() { var d = new Date().getTime(); if (window.performance && typeof window.performance.now === "function") { d += performance.now(); //use high-precision t...转载 2018-10-30 11:03:27 · 4062 阅读 · 0 评论 -
jspdf指定部分转PDF并进行下载(支持中文)
function download1(){ var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isIE=window.ActiveXObject || "ActiveXObject" in window if (isIE){ alert('抱歉,暂不支持IE浏览器下载!'); re原创 2018-01-22 16:46:52 · 5765 阅读 · 1 评论 -
javascript增加或减少月份
function addMonth(date,monthNum){ var day=date.getDate(); if(monthNum>0){ date.setMonth(newDt.getMonth()+monthNum); }else{ monthNum=Math.abs(monthNum);原创 2017-11-28 18:08:40 · 830 阅读 · 2 评论 -
easyui启用行号错位解决方案
$("#dataGrid").datagrid({ onLoadSuccess : function () { $(this).datagrid("fixRowHeight"); }});加入上面的代码就可以解决!原创 2017-07-04 16:28:57 · 3284 阅读 · 1 评论 -
使用qrcode.js生成二维码图片
Javascript 二维码生成库:QRCodevar qrcode = new QRCode(document.getElementById("qrcode"), { width : 100, height : 100});function makeCode () { var elText = document.getElementById("text");转载 2017-06-19 16:28:59 · 2448 阅读 · 0 评论 -
JS最新的身份证验证代码
<script> function reproving() { //验证身份证 var code=$("#cardId").val().toUpperCase(); $("#cardId").val(code); var city={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古"原创 2016-08-31 16:19:00 · 502 阅读 · 1 评论