随笔分类 -  前端

摘要:1、把输入框(input、textarea等)的非数字替换成空,只允许输入数字 : onkeyup="this.value=this.value.replace(/\D/g,'')" 2、文字居中:text-align: center; 控件居中: margin:0px auto 0 3、验证inp 阅读全文
posted @ 2017-12-03 17:55 zhoudingzhao 阅读(148) 评论(0) 推荐(0) 编辑
摘要:<select id="orderStatus" name="stats"> <option <c:if test="${order.rStatus eq 5}">selected</c:if> value="5">退款中</option> <option <c:if test="${order.r 阅读全文
posted @ 2016-07-26 13:50 zhoudingzhao 阅读(234) 评论(0) 推荐(0) 编辑
摘要:JS请求后台数据报错: XMLHttpRequest cannot load http://192.168.1.163/ajaxdemo/server.php?number=101. No 'Access-Control-Allow-Origin' header is present on the 阅读全文
posted @ 2016-06-07 15:26 zhoudingzhao 阅读(165) 评论(0) 推荐(0) 编辑
摘要:1、下载 XAMPP 套件: https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/stats/timeline 下载的文件是 xampp-linux-x64-7.0.6-0-installer.run 2、 执行 ./xampp-li 阅读全文
posted @ 2016-05-30 18:24 zhoudingzhao 阅读(1894) 评论(0) 推荐(0) 编辑
摘要:offset()获取标签离左上角的位置,离顶部和左部的距离。离整个屏幕的左上角的距离。 position() 相对于某一个标签的位置。离父标签的距离。离父标签的左上角的距离。 height(), width() 自己的高度 和宽度。不包括边框。innerHeight() , innerWidth() 阅读全文
posted @ 2016-05-29 10:14 zhoudingzhao 阅读(120) 评论(0) 推荐(0) 编辑
摘要:一、 javascript 的 内置对象: Object 和 Function javascript所有东西,包括 Function 都是对象 。 Array 其实是一个 Function 类型的对象, 它的prototype 是指向了 Function.prototype 。 new Array( 阅读全文
posted @ 2016-05-27 00:20 zhoudingzhao 阅读(221) 评论(0) 推荐(0) 编辑
摘要:nodejs 可以直接在返回中使用html标签,例如下面的格式,返回 hello world 将会使用 h1 字体。 app.get('/html',function(req,res){ res.status(200).send('<h1>hello world</h1>');}); "E" is 阅读全文
posted @ 2016-05-25 17:49 zhoudingzhao 阅读(6369) 评论(0) 推荐(0) 编辑
摘要:1、toggleClass() 如果对象有class属性,则删除; 如果没有class属性,则加上。 <style> .hide{ display: none; } </style> <div id='nid'>12<a>google</a>34</div> $('#nid').toggleClas 阅读全文
posted @ 2016-05-25 00:25 zhoudingzhao 阅读(162) 评论(0) 推荐(0) 编辑
摘要:jquery 的 for 循环: 1、 var userList = [11,22,33,44]; $.each(userList,function(i,item){ console.log(i, item); }); 结果输出: 0 11 1 22 2 33 3 44 用法: $.each() 第 阅读全文
posted @ 2016-05-24 23:45 zhoudingzhao 阅读(52566) 评论(1) 推荐(0) 编辑
摘要:jquery的作用: 获取标签, 修改内容。$ 等于jquery 对象。 一、选择器 1、<div id="n1">test</div> 找到该标签并修改: $('#n1').text('123'); // #n1 相当于 id=n1 2、找到页面上所有的div 并修改: $('div').text 阅读全文
posted @ 2016-05-22 22:53 zhoudingzhao 阅读(163) 评论(0) 推荐(0) 编辑