上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 如果我们要让某个DOM节点监听事件,最简单的方法就是使用 on+xxx 方法,但是如下时,后面的事件会把前面的事件覆盖掉,只会弹出 2 。var div=document.getElementById('div');div.onclick = function(){ alert(1);}div.onclick = function(){ alert(2);}我们可以使用以下方法来解决这个问题。//////绑定事件监听器function addEventHandler(target,type,func){ if(target.addEventListener){target.a. 阅读全文
posted @ 2013-03-18 09:28 hold su 阅读(161) 评论(0) 推荐(0) 编辑
摘要: document.write() //输出------------------document.getElementById("id号").value//获取input的值------------------document.getElementById("id号").widht//获取宽度------------------document.getElementById("id号").height//获取高度------------------alert()//警告框------------------return//程序结束,返回 阅读全文
posted @ 2013-03-18 09:27 hold su 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 最近项目中需要实现在客户端导出excel的功能,不想受浏览器的限制,不想受是否安装excel的限制,通过强大的谷哥找到以下两种方案:1. 使用downloadify,这是基于flash的一个组件,支持原生js,以及jquery, mootools等调用。看demo可以导出文本文件,从而肯定可以导出csv文件,而实现导出excel的功能。后来发现,大名鼎鼎的ExtJs中的Grid,也是使用这个实现的在client导出excel。地址:https://github.com/dcneiner/Downloadify http://downloadify.info(这个地址打不开,不知是被墙了还是.. 阅读全文
posted @ 2013-03-18 09:26 hold su 阅读(316) 评论(0) 推荐(0) 编辑
摘要: /* 密码输入框 */ var tx = document.getElementById("tx"), pwd = document .getElementById("pwd"); tx.onfocus = function() { if (this.value != "请输入密码"){ return; }else{ this.select(); } } tx.onclick=function(){ this.style.display = "none"; pwd.style.display = "&qu 阅读全文
posted @ 2013-03-18 09:24 hold su 阅读(1052) 评论(0) 推荐(0) 编辑
摘要: 默认的html滚动条很难看,一些漂亮的网站,滚动条都是针对网站整体样式配套设计的。在网上搜索到两种改造方式。一种是给默认滚动条设置样式,另一种是使用设计好的图片+css+js。都挺好用的。第一种(纯css):完成后.div{ scrollbar-face-color: #ebebeb;scrollbar-shadow-color: #ffffff; scrollbar-highlight-color:#ffffff; scrollbar-3dlight-color: #d8d8d8; scrollbar-darkshadow-color: #d8d8d8; scrollbar-track-c. 阅读全文
posted @ 2013-03-12 18:44 hold su 阅读(667) 评论(0) 推荐(0) 编辑
摘要: 选择器实例选取*$("*")所有元素#id$("#lastname")id="lastname" 的元素.class$(".intro")所有 class="intro" 的元素element$("p")所有 <p> 元素.class.class$(".intro.demo")所有 class="intro" 且 class="demo" 的元素:first$("p:first")第一 阅读全文
posted @ 2013-03-11 19:49 hold su 阅读(113) 评论(0) 推荐(0) 编辑
摘要: <?xml version='1.0' encoding='utf-8'?><Server port="8005" shutdown="SHUTDOWN"> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated a 阅读全文
posted @ 2013-03-11 09:40 hold su 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 今天一个同学需要处理一个excel文件,于是我便在网上搜了一下方法,顺便自己研究一下。刚刚参考网上资料,使用poi库测试了一下读取excel文件,效果不错,跟大家分享一下。要读取的excel文件内容如下:第一列是数值型,第二列是字符型,代码如下:package poi;import java.io.FileInputStream;import java.io.InputStream;import java.util.Iterator;import org.apache.poi.hssf.extractor.ExcelExtractor;import org.apache.poi.hssf.us 阅读全文
posted @ 2013-03-11 09:38 hold su 阅读(409) 评论(0) 推荐(0) 编辑
摘要: Action是什么 在Struts2中,一个Action类代表一次请求或调用,每个请求的动作都对应于一个相应的Action类,一个Action类是一个独立的工作单元。也就是,用户的每次请求,都会转到一个相应的Action类里面,由这个Action类来进行处理,因此一个Action类代表了用户的一次请求或调用。简单来说,Action就是用来处理一次用户请求的对象。Action能干什么public class HelloWorldAction implements Action { private String account; private String ... 阅读全文
posted @ 2013-03-11 09:36 hold su 阅读(182) 评论(0) 推荐(0) 编辑
摘要: MySQL数据库中有两个表,一个student,一个teacher其中student表结构如下teacher表如下有存储过程checkAll?1234BEGINselect * from teacher; SELECT * FROM student; ENDJava代码如下 1 public static Map<String,Object>getAll(){ 2 Connection conn=null; 3 CallableStatement cs=null; 4 ResultSet rs=null; 5 Map<St... 阅读全文
posted @ 2013-03-11 09:33 hold su 阅读(579) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页