随笔分类 -  js ,jq

摘要:function get_primes(arr) { return arr.filter(function (element) { var flag = true; if(element < 2){ flag = false; } else { for(var i=2;i<element;i++){ 阅读全文
posted @ 2022-07-12 09:34 盘思动 阅读(118) 评论(1) 推荐(0)
摘要:var r,arr = ['apple', 'strawberry', 'banana', 'pear', 'apple', 'orange', 'orange', 'strawberry']; r = arr.filter(function (element, index, self) { con 阅读全文
posted @ 2022-07-12 09:16 盘思动 阅读(637) 评论(1) 推荐(0)
摘要:changeColor() { let color = '#' + Math.floor( Math.random() * 0xffffff ).toString(16); } 阅读全文
posted @ 2022-06-30 15:30 盘思动 阅读(74) 评论(0) 推荐(0)
摘要:demo 1 demo2 var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.splice(2,1,"Lemon","Kiwi"); 输出结果: Banana,Orange,Lemon,Kiwi,Mango 可以对比php中arra 阅读全文
posted @ 2021-11-03 11:17 盘思动 阅读(236) 评论(2) 推荐(0)
摘要:我们可以使用 JSON.parse() 方法将数据转换为 JavaScript 对象 阅读全文
posted @ 2021-10-15 20:10 盘思动 阅读(130) 评论(0) 推荐(0)
摘要:window.location.href = document.referrer; 先抓取到上个页面的链接 document.referrer; 阅读全文
posted @ 2021-08-06 17:56 盘思动 阅读(133) 评论(4) 推荐(0)
摘要:var cheng = xmSelect.render({ el: '#cheng_xm_select_id', data: [ <?php foreach($cheng_user_list as $v){ ?> <?php if($v['is_sign'] == 1){ ?> <?php echo 阅读全文
posted @ 2021-08-04 18:01 盘思动 阅读(849) 评论(0) 推荐(0)
摘要:<input class="form-control-erbi col-lg-3" min=1 oninput="javascript:this.value=this.value.replace(/[^\d]$/g,'')" type="text" name="weight" id="weight" 阅读全文
posted @ 2021-05-08 14:20 盘思动 阅读(825) 评论(0) 推荐(0)
摘要:长链接测试网页:http://coolaf.com/tool/chattest // var intervalID = setInterval(() => { // console.log('gggg'); // getImg() // }, 3000); // function getImg() 阅读全文
posted @ 2021-02-23 17:51 盘思动 阅读(138) 评论(0) 推荐(0)
摘要:html 代码 <tr data-id="{$vo.id}" data-table_name="article"> <td>{$vo.id}</td> <td>{$vo.title}</td> <td>{$vo.cate_name}</td> <td>{$vo.browse_num}</td> <t 阅读全文
posted @ 2020-07-30 11:47 盘思动 阅读(171) 评论(0) 推荐(0)
摘要:如果是整数类型 可以用digit 类型来取代number, digit maxlength 属性就生效了~ 阅读全文
posted @ 2020-07-24 14:55 盘思动 阅读(191) 评论(0) 推荐(0)
摘要:``` 首先得知道window.showModalDialog()方法到底是干嘛的,有什么作用.基本介绍: showModalDialog() (IE 4+ 支持) showModelessDialog() (IE 5+ 支持) window.showModalDialog() 方法... 阅读全文
posted @ 2020-05-20 09:03 盘思动 阅读(3304) 评论(0) 推荐(0)
摘要:"" 阅读全文
posted @ 2020-05-08 09:07 盘思动 阅读(161) 评论(0) 推荐(0)
摘要:``` var tmp_arr_1 = new Array(); var tmp1 = {'type':1,'plan_num':200}; tmp_arr_1.push(tmp1); tmp_arr_1.push(tmp1); console.log(tmp_arr_1); tmp_arr_1[0]['type'] = ' '; console.log('--变化一个后--'); console 阅读全文
posted @ 2020-04-28 16:32 盘思动 阅读(2661) 评论(0) 推荐(0)
摘要:``` js中字符串的替换在js中字符串全部替换可以用以下方法:两种区别:正则&常规str.replace("需要替换的字符串","新字符串") str.replace(/需要替换的字符串/g,"新字符串")比如:"yyyy-MM-dd-hh-mm-ss".replace("-","/")结果如下: "yyyy/MM-dd-hh-mm-ss""yyyy-MM-dd-hh-mm-ss".replac... 阅读全文
posted @ 2020-04-13 21:25 盘思动 阅读(14576) 评论(0) 推荐(0)
摘要:new Promise(function(resolve){ console.log('马上执行for循环'); for(var i = 0; i < 1000; i++){ resolve(); console.log(i); } }).then(function(){ console.log(' 阅读全文
posted @ 2020-04-09 22:27 盘思动 阅读(954) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-03-19 16:20 盘思动 阅读(715) 评论(1) 推荐(0)
摘要:window.parent.location.reload(); history.go(-1);// 仅仅返回,没有再刷新的效果 阅读全文
posted @ 2020-03-12 14:33 盘思动 阅读(347) 评论(0) 推荐(0)
摘要:``` art-templatehttp://aui.github.io/art-template/``` 阅读全文
posted @ 2020-03-12 14:21 盘思动
摘要:``` $("#subForm").submit(function() { $.ajax({ url: "/api.php/Jd/sub", data: $("#subForm").serializeArray(), type: "POST", dataType: "json", success: function(data) { var errno = ... 阅读全文
posted @ 2020-03-11 22:16 盘思动 阅读(276) 评论(0) 推荐(0)