http://www.codebit.cn/javascript/get-scroll-position.ht…
不静之心
作者:<span class="vcard">不静之心</span>
PHP正则表达式使用详解
详解:http://www.phpweblog.net/jarryyip/archive/2008/05/11…
使用PHP对配置文件进行修改
http://www.phpweblog.net/kiyone/archive/2007/07/04/1432…
php跳转的三种方法
方法一:使用PHP自带函数 Header(“Location:网址”); 说明:必须在…
PHP判断Form表单是否提交
|
1 2 3 4 5 6 7 8 9 |
$action=$HTTP_POST_VARS["Button1"]; if($action=="提交") { //执行表单操作 } else { //读取默认值 } |
本篇文章来源于 永余PHP开源技术社区 | …
js实现trim的功能
|
1 2 3 4 5 6 7 8 9 10 11 12 |
trim:function(str){ return str.replace(/(^\s*)|(\s*$)/g, ""); } ltrim:function(str){ return str.replace(/(^\s*)/g, ""); } rtrim:function(str){ return str.replace(/(\s*$)/g, ""); } |
mysql_fetch_row,mysql_fetch_array,mysql_fetch_assoc的区别
http://www.jb51.net/article/17853.htm mysql_fetch_row,这…
js创建自定义对话框
一: 这是只是一个很简单的例子 Js代码
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
createDialog: function(flag){ var dialogMark = document.getElementById("dialogMark"); var dialogContent = document.getElementById("dialogContent"); var dialogIframe = document.getElementById("dialogIframe"); if(typeof(dialogContent)=="unfined"||dialogContent==null){ dialogContent = document.createElement("div"); dialogContent.id="dialogContent"; dialogContent.innerHTML="This is a message of dialog."; dialogContent.style.backgroundColor="#FF0000"; dialogContent.style.width="100%"; dialogContent.style.height="100%"; dialogContent.style.border="1px solid #00FFFF"; } if(typeof(dialogMark)=="unfined"||dialogMark==null){ dialogMark = document.createElement("div"); dialogMark.id="dialogMark"; dialogMark.innerHTML="[<a href='#' onclick=\"commonUtils.createDialog('N')\">X</a>]"; dialogMark.style.backgroundColor="#FF00FF"; dialogMark.style.top="100px"; dialogMark.style.left="100px"; dialogMark.style.width="600px"; dialogMark.style.height="300px"; dialogMark.style.position="absolute"; dialogMark.style.filter="alpha(opacity=80)"; dialogMark.style.border="2px solid #00FF00"; dialogMark.appendChild(dialogContent); document.body.appendChild(dialogMark); } if(typeof(dialogIframe)=="unfined"||dialogIframe==null){ dialogIframe = document.createElement("iframe"); dialogIframe.id="dialogIframe"; dialogIframe.style.backgroundColor="#660066"; dialogIframe.style.top="0px"; dialogIframe.style.left="0px"; dialogIframe.style.width=window.screen.availWidth+"px"; dialogIframe.style.height=window.screen.availHeight+"px"; dialogIframe.style.filter="alpha(opacity=20)"; dialogIframe.style.position="absolute"; //dialogIframe.appendChild(dialogMark); document.body.appendChild(dialogIframe); } if(flag=="Y"){ dialogIframe.style.zIndex=10000; dialogMark.style.zIndex=10001; dialogContent.style.zIndex=10002; dialogIframe.style.display=""; dialogMark.style.display=""; dialogContent.style.display=""; }else{ dialogIframe.style.zIndex=-1; dialogMark.style.zIndex=-2; dialogContent.style.zIndex=-3; dialogIframe.style.display="none"; dialogMark.style.display="none"; dialogContent.style.display="none"; } } |
为…
JS获得鼠标位置
http://www.jb51.net/article/16645.htm [crayon-6a8821bc8…
如何在地址栏中显示网站的图标
http://hi.baidu.com/langyanqi/blog/item/3316544e9bdb640…
十五种CSS鼠标样式
http://linder0209.iteye.com/blog/875203 CSS鼠标样式语法如下: 任意…
ps切图转网页代码(psd to html)
转自:http://shansun123.iteye.com/blog/534161 例子: http://w…
垂直居中的两种实现方法
方法一:利用行高(line-height)定位 line-height通常是用于调节一段文字的行与行之间的距离…
让图片 div居中实现代码
http://www.huomaw.com/css/201010/8171.html [cray…
javascript 生成随机颜色
http://hi.baidu.com/lovebwf/blog/item/ddf768168f31894f2…
CSS 禁止滚动条
http://www.lunelove.com/david/Article.asp?ItemID=92 1、完…
css样式控制超链接颜色显示
http://www.wangchao.net.cn/bbsdetail_1846946.html 很多人在网…
js对表格的操作
http://dikar.iteye.com/blog/143593 [crayon-6a8821bc883f…
手把手教你开发Chrome扩展三:关于本地存储数据
详细内容看 http://www.cnblogs.com/walkingp/archive/2011/04/0…
JLabel文本自动换行,限定宽度获取高度
http://blog.csdn.net/polarman/article/details/4160045 U…
Build.xml模板
一个通用Build.xml模板的建立 http://www.blogjava.net/os586/archiv…
oracle 动态执行sql
oracle 使用DBMS_SQL包动态执行sql http://blog.csdn.net/wbj12345…
java读取图片长宽问题
参考 Java代码 http://www.java3z.com/cwbwebhome/article/arti…
hashmap,hashtabl,hashtree,linkedhashmap区别分析
java为数据结构中的映射定义了一个接口java.util.Map;它有四个实现类,分别是HashMap Ha…
方法拦截器:MethodInterceptor
注意: 下面的配置不是拦截Controller的, 拦截Controller的需要在servlet.xml, …
ThrowsAdvice和自动代理的例子
参考: http://www.blogjava.net/liuwentao253/archive/2007/0…
一个用Spring AOP实现异常处理和记录程序执行时间的实例
http://blog.csdn.net/liuzhenwen/article/details/3938883
MessageUtils:ResourceBundle访问properties文件
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
package com.app; import java.io.Serializable; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import org.apache.commons.lang.StringUtils; public class MessageUtils implements Serializable{ /** * @param args */ private static String locale; private static ResourceBundle bind; private static String baseName; public static String getBaseName() { return baseName; } public static void setBaseName(String baseName) { MessageUtils.baseName = baseName; bind = null; } public static String getMessage(String key){ String message = null; try { message = getBind().getString(key); } catch (MissingResourceException e) { return "@@ Not found message for key="+key; } if(StringUtils.isBlank(message)) return "@@ Not found message for key="+key; return message; } public static String getMessage(String key,Map<String,String> values){ String message = null; try { message = getBind().getString(key); } catch (MissingResourceException e) { return "@@ Not found message for key="+key; } if(StringUtils.isBlank(message)) return "@@ Not found message for key="+key; if(values==null) return message; Iterator it = values.keySet().iterator(); while(it.hasNext()){ String paraName = it.next().toString(); key.replaceAll("{"+paraName+"}", values.get(paraName).toString()); } return message; } public static String getMessage(String key,String[] values){ String message = null; try { message = getBind().getString(key); } catch (MissingResourceException e) { return "@@ Not found message for key="+key; } if(StringUtils.isBlank(message)) return "@@ Not found message for key="+key; if(values==null||values.length==0) return message; for(int i=0; i<values.length; i++){ key.replaceAll("{"+i+"}", values[i]); } return message; } public static String getMessage(String key,List<String> values){ String message = null; try { message = getBind().getString(key); } catch (MissingResourceException e) { return "@@ Not found message for key="+key; } if(StringUtils.isBlank(message)) return "@@ Not found message for key="+key; if(values==null||values.size()==0) return message; for(int i=0; i<values.size(); i++){ key.replaceAll("{"+i+"}", values.get(i)); } return message; } public String getLocale() { return locale; } public void setLocale(String locale) { this.locale = locale; } private static ResourceBundle getBind() { if(baseName==null) baseName = "locale.message"; if (bind == null) { if (locale == null || locale.equals("")) //src/locale/message.properties bind = ResourceBundle.getBundle(baseName); else bind = ResourceBundle.getBundle(baseName + locale); } return bind; } public void setBind(ResourceBundle bind) { this.bind = bind; } public void reset(){ bind = null; baseName = null; } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(MessageUtils.getMessage("com.s2s3h3.app.testMessage",new String[]{"aaa","bbb"})); MessageUtils.setBaseName("struts"); System.out.println(MessageUtils.getMessage("struts.login.pageName")); } } |
java.util.MissingResourceException: Can’t find bundle for base name
解决办法 1: http://blog.sina.com.cn/s/blog_4bb5650c01007t2f…
jxl得到一个字符串的宽度
|
1 2 3 |
JLabel jlabel = new JLabel(test_str); FontMetrics fm = jlabel.getFontMetrics(new java.awt.Font("Times New Roman",java.awt.Font.PLAIN, 12)); System.out.println("string width="+fm.stringWidth(test_str)); |
jxl读取行高度的问题
|
1 |
sheet.getRowView(0).getDimension() |
这一段代码就是读取行高度。 我现在要放一段数…
HTML的hr变成虚线
|
1 2 |
border: none; border-top: 1px dotted #ccc; |
jQuery选择器整理
http://blog.csdn.net/paulgerchen/archive/2010/06/03/564…
预览文章: 一个Jquery的圆角插件
http://jrc.rctonline.nl/
Validation验证多次提交重复积累信息的解决办法
http://news.qiku.info/blog/3702.html 让XXXAction类实现Prepa…
