随笔分类 - js
摘要:function getYourString(s) { var res = ''; var length = s.length; for (var i = 0, j = 1; i '; } else { res += s[i]; } } ...
阅读全文
摘要:转载:http://blog.csdn.net/sushauai/article/details/52958162 侵删 转载:http://blog.csdn.net/sushauai/article/details/52958162 侵删 转载:http://blog.csdn.net/sush
阅读全文
摘要:账单打印 Ι 收据打印 返回账单列表 打印 ...
阅读全文
摘要:npm install -g cnpm --registry=https://registry.npm.taobao.org
阅读全文
摘要://调用 var a = { "aa":11, "bb":22 } objToArray(a) // [0:11,1:22]
阅读全文
摘要://分页下拉 var ajaxScroll = function() { var screenHeight = window.screen.height; $(document).scroll(function() { if (screenHeight + document.body.scrollTop >= document.body.scrollHeight)...
阅读全文
摘要://调用,description为class名wordlimit('description', 30)
阅读全文
摘要:ajax 请求数据的时候 var jz_roomId = $('#jz_roomId');$(jz_roomId).select2({ dropdownParent: $(".customerRoomIdModal"), ajax: { url: webroot + '/spaceRoom/list
阅读全文
摘要:function roomIds(roomid) { // var str = roomid.replace(/;/g,'\r\n'); if (roomid) { var str = roomid.replace(/;/g, ''); return str; } else { return '暂无'; } }
阅读全文
摘要:function toDecimal2(x) { var f = parseFloat(x); if (isNaN(f)) { return false; } var f = Math.round(x*100)/100; var s = f.toString(); var rs = s.indexOf('.'); if (r...
阅读全文
摘要:function getobjArr (data) { var result = []; data.HELMET.system = '系统分类' // console.log(data) $.each(data.HELMET, function (index_h, e...
阅读全文
摘要:var arrsAll = ['1','1','1']; console.log('isAllEqual',isAllEqual(arrsAll)); //true
阅读全文
摘要:var ary = new Array("111", "22", "33", "111"); console.log(arrHasvalue(ary)); //true
阅读全文
摘要:var arrs = ['1','2','3']; console.log(arrHasValue(1,arrs)); //true
阅读全文
摘要://金额处理 var number = 1234567.35; if (parseInt(number) == number) { var money = number.toString().split(''); var unit = money[money.length - 1]; var decade = money[m...
阅读全文
摘要:console.log('fmoney',fmoney(100.12243, 2)) //100.12
阅读全文
摘要:console.log(smalltoBIG(43533534.78));
阅读全文
摘要:来自:SangSir 链接:https://segmentfault.com/a/1190000012673854 原文:https://www.sitepoint.com/shorthand-javascript-techniques/ 1.三元操作符 当想写 if...else 语句时,使用三元
阅读全文
摘要:ajaxJson('POST', url, JSON.stringify(param), function(err, result){ //result or rsp // if(SUCCESS){ //....... }else{ //....... } }); —————————————————
阅读全文