原创 laydate去除秒,和分的格式

去除秒CSS代碼 /*去除時間選擇的秒*/ .layui-laydate-content>.layui-laydate-list { padding-bottom: 0px; overflow:

原创 layui設置input高度和table行高度

//input高度 .layui-form-label { padding: 5px 15px; } .layui-input, .layui-select, .layui-textarea { height: 30px

原创 頁面多個layui數據表格時,根據ID獲取對應表格數據

版本2.2.6 中 使用 layui.table.cache.tablename 可以取到表格中所有數據 tablename :表格ID

原创 解決IE中promise未定義問題

原文鏈接:https://blog.csdn.net/qq_40292164/article/details/83000229 原因是ie不支持es6語法,需要導入依賴包 1、npm insta

原创 JS判斷字符佔用字節長度

字母、數據各佔一個字節,中文佔2個字節 return str.replace(/[\u0391-\uFFE5]/g,"aa").length \u0391-\uFFE5 匹配雙字節字符(漢字+符號) str:要檢測的字符串

原创 layui table點擊行,選中前面的radio

$(obj.tr).children().children().children().prop('checked',true)

原创 layui顯示錶格數據的id的兩種形式

方法一:.獲取數據庫表字段id {field: 'id', title: '用戶ID', width:100, fixed: 'left', align:'center', templet: functi

原创 JS獲取最近一週的時間

const end = new Date() const start = new Date() start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const date = [st

原创 $(...).bootstraptable is not a function

 先貼問題吧!在一個頁面引入了另一個頁面的模態框,然後就開始報這種 is not a function的錯誤,一度以爲是bootstrap的js文件沒有導入,檢查了n遍是沒有問題的那麼還有可能就是jQuery的文件沒有寫在最上面,看了一下

原创 一行js代碼實現時間戳轉時間格式

前端開發過程中,常常需要將時間戳轉化爲標準時間格式供用戶瀏覽。不借助方法庫的情況下,如何又快又好的實現呢?下面介紹兩種方法。 老方法 平常用的基本是這個方法,用Date方法依次將年月日時分秒一個個算出來,然後拼接成需要的時間格式字符串

原创 url傳參傳json字符串

傳參 window.location.href = 'http://192.168.1.102:8000?url='+ encodeURIComponent(JSON.stringify(a));  接收參數 decodeUR

原创 Echarts自定義地圖--自定義區域背景圖顏色

效果圖 series: [{ name: 'mapSer', type: 'map', roam: true,

原创 jquery請求超時設置

//初始化下拉框 function initSelect() { var xhr=$.ajax({ url:_ip+'Service/GetModelName',

原创 jsTree添加給節點添加自定義屬性

遇到一個jsTree節點添加自定義屬性的問題的  在節點中添加"a_attr":{"href":"qwqwe"} 就可以了 demo  [ "Simple root node", { "text" :

原创 ajax請求添加自定義header參數

$.ajax({ type: "post", url:"http://127.0.0.1:4564/bsky-app/template/testPost",