摘要: 字符串去掉所有空格 "abc 123 def".replace(/\s/g, "") 字符串去掉左右两端空格 " abc 123 def ".replace(/(^\s*)|(\s*$)/g, ""); 字符串去掉左边空格 " abc 123 def ".replace(/(^\s*)/g,""); 阅读全文
posted @ 2017-10-23 11:09 成忠 阅读(333) 评论(0) 推荐(0) 编辑
摘要: sortable.js拖放排序插件的事件api 详情请查看: 阅读全文
posted @ 2017-05-18 14:42 成忠 阅读(2972) 评论(0) 推荐(0) 编辑
摘要: 一、当iframe自适应高度,无滚动条时候: 例如这样: 或者这样: 二、当iframe页面存在滚动条就简单很多了 例如这样: 阅读全文
posted @ 2017-04-28 15:54 成忠 阅读(3215) 评论(0) 推荐(0) 编辑
摘要: 今天主要的学习内容是cookie与本地储存的知识, 在HTML5中,本地存储是一个window的属性,包括localStorage和sessionStorage,从名字应该可以很清楚的辨认二者的区别,前者是一直存在本地的,后者只是伴随着session,窗口一旦关闭就没了。二者用法完全相同,这里以lo 阅读全文
posted @ 2017-03-20 16:54 成忠 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 字符串转成json数据,和json转成字符串方法 大概流程: 父级页面通过接口获取的数据: 获取数据后处理的方法: 其中这两个就是存储数据: 子页面接收数据并转为json格式: 阅读全文
posted @ 2017-03-20 10:12 成忠 阅读(1799) 评论(0) 推荐(1) 编辑
摘要: W3C地址::::::: http://www.w3school.com.cn/jsref/met_win_confirm.asp http://www.w3school.com.cn/tiy/t.asp?f=hdom_confirm 阅读全文
posted @ 2017-03-03 11:04 成忠 阅读(1444) 评论(0) 推荐(0) 编辑
摘要: <input type="button" id="submit" value="提交"> <script> $(document).ready(function(){ $("#submit").click(function(){ var nowTime = new Date().getTime(); 阅读全文
posted @ 2017-02-24 15:04 成忠 阅读(7732) 评论(0) 推荐(2) 编辑
摘要: 方法一: <script> function hideImg(i) { var imgs = i.contentWindow.document.getElementsByTagName('img'); for(var i=0;i<imgs.length;i++)imgs[i].style.displ 阅读全文
posted @ 2017-02-15 17:42 成忠 阅读(41975) 评论(1) 推荐(0) 编辑
摘要: $.ajax({ type:"get", url:spanUrl, dataType:'jsonp', jsonpCallback:'jsonp',//jsonp数据,需要数据库提供这个jsonp格式 success:function(selDate){ var htmlStr1 = '<a hre 阅读全文
posted @ 2017-02-15 15:46 成忠 阅读(6913) 评论(0) 推荐(0) 编辑
摘要: //var price=parseInt(data[0].price).toLocaleString();//仅支持PC端不支持移动端 //金钱价格每3位一个逗号function addCommas(nStr){ nStr += '';//改变成字符串 x = nStr.split('.'); x1 阅读全文
posted @ 2017-02-15 15:44 成忠 阅读(408) 评论(0) 推荐(0) 编辑