随笔分类 -  JavaScript脚本

原生的js脚本
摘要://时钟显示 function clockon() { var now = new Date(); var year = now.getFullYear(); //getFullYear getYear var month = now.getMo... 阅读全文
posted @ 2014-05-12 09:39 流浪在阿尔卑斯的野狼 阅读(575) 评论(0) 推荐(0)
摘要:在form标签中的格式<form action="xxxx.asp" method="post" name="form1" id="form1" target="iframe_operate" onSubmit="return check_form(form1)"></form>现在需要一个ifarme标签。放到form标签的结尾处 <iframe width="0" height="0" src=&quo 阅读全文
posted @ 2012-12-29 09:50 流浪在阿尔卑斯的野狼 阅读(851) 评论(0) 推荐(1)
摘要:$("#父窗口元素ID",window.parent.document);对应javascript版本为window.parent.document.getElementByIdx_x("父窗口元素ID");取父窗口的元素方法:$(selector, window.parent.document);那么你取父窗口的父窗口的元素就可以用:$(selector, window.parent.parent.document);类似的,取其它窗口的方法大同小异$(selector, window.top.document);$(selector, window. 阅读全文
posted @ 2012-10-09 11:57 流浪在阿尔卑斯的野狼 阅读(329) 评论(0) 推荐(0)
摘要:需求:多个复选框,要求选中其中一项,如果text的值为空,给出提示。如下图所示:html 代码如下<input type="checkbox" name="select_no_audit_reason" id="select_no_audit_reason" value="1"><input type="checkbox" name="select_no_audit_reason" id="select_no_audit_reason" 阅读全文
posted @ 2012-09-17 17:01 流浪在阿尔卑斯的野狼 阅读(1503) 评论(0) 推荐(0)
摘要:解决方法:重新注册下以下文件,问题便解决了:msscript.ocxdispex.dllvbscript.dllscrrun.dllurlmon.dll注册方法为,在开始运行里面运行 regsvr32 msscript.ocx 以此类推,注册完后清理一下浏览器缓存之类的。 阅读全文
posted @ 2012-09-04 12:42 流浪在阿尔卑斯的野狼 阅读(297) 评论(0) 推荐(0)
摘要:PS:文章来源于网络。第一种:<script language="javascript" type="text/javascript"> window.location.href="login.jsp?backurl="+window.location.href; </script>第二种:<script language="javascript"> alert("返回"); window.history.back(-1); </script>第三 阅读全文
posted @ 2012-08-27 11:05 流浪在阿尔卑斯的野狼 阅读(184) 评论(0) 推荐(0)
摘要:最近的项目中经常要用到,返回上一级页面的时候自动刷新页面,蛋疼了好几天,终于可以实现了:<script language="JavaScript"> alert("图片广告内容操作成功!"); window.history.go(-2); window.opener.location.reload(); window.close();</script> 注意: window.opener.location.reload();这一段代码是刷新上一级页面的关键:window:js中的对象,包含一些常见的js操作窗体方法。window. 阅读全文
posted @ 2012-08-24 18:15 流浪在阿尔卑斯的野狼 阅读(377) 评论(0) 推荐(0)