javascript
共 5 篇文章
js获得本周,本月,本季度的开始日期和结束日期
<script> var now = new Date(); //当前日期 var nowDayOfWeek = now.getDay(); //今天本周的第几天 var nowDay = now.getDate(); //当前日 var nowMonth = now.getMonth(); //当前月 var nowYear = now.getYear(); //当前年 nowYear += (nowYear < 2000) ? 1900 : 0; // //格式化日期:yyyy-MM-dd function formatDate(date) { var myyear = date.get…
2011-01-14 10:34 · javascript
Jquery使用小技巧
禁止右键点击 $(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; }); }); 隐藏搜索文本框文字view plaincopy to clipboardprint? $(document).ready(function() { $("input.text1").val("Enter your search text here"); textFill($('input.text1')); }); function textFill(input){ //input foc…
2010-12-29 22:02 · javascript
用 Javascript 实现锚点(Anchor)间平滑跳转
原文引用:http://www.codebit.cn/pub/html/javascript/tip/anchor_scroller/ 原文引用:http://www.codebit.cn/pub/html/javascript/tip/anchor_scroller/ 原文引用:http://www.codebit.cn/pub/html/javascript/tip/anchor_scroller/ 原文引用:http://www.codebit.cn/pub/html/javascript/tip/anchor_scroller/
2010-12-13 10:30 · javascript
javascript常用55个技巧
oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键 onpaste="return false" 不准粘贴 oncopy="return false;" oncut="return false;" 防止复制 关闭输入法 永远都会带着框架 防止被人frame 网页将不能被另存为 <*** src="/ .html>"; </ **> <input type=button value="/查看网页源代码 onclick="window.location = "view-source:"+ "http://www.pconline.co…
2009-11-30 23:51 · javascript
javascript:window.location 详细用法
http://localhost/test/test.htm?id=1 <head> </head> <body> <script languge=javascript> alert(window.location.pathname); --返回 /test/test.htm alert(window.location.search); --返回 ?id=1 alert(window.location.href); --返回 http://localhost/test/test.htm?id=1 </script> </body> </html> location对象 含有当前URL的信息.…
2009-11-19 14:32 · javascript