Skip to content

Instantly share code, notes, and snippets.

@MaySnow
MaySnow / checkbox.js
Created October 7, 2012 09:15
checkbox
//根据选中的长度来判断是否有选中的,真是个不错的办法
if($(".check:checked").length == 0) {
hideChoose();
} else {
showChoose();
}
$(".check:checked")//所有选中的复选框
@MaySnow
MaySnow / history.js
Created October 7, 2012 08:26
改变地址栏,不跳转
var href = "<%=basePath %>contact/findByTag.action?tagName=" + tagName;//需要改变的地址名称
history.pushState({ path: this.path }, '', href);
@MaySnow
MaySnow / json.java
Created October 6, 2012 08:39
Gson
public String showJson() throws IOException {
user = new User();
user.setId(1001);
user.setPassword("000000");
user.setUsername("tom");
response.setContentType("application/json;charset=UTF-8");
Gson gson = new Gson();
PrintWriter out = response.getWriter();
out.print(gson.toJson(user));
@MaySnow
MaySnow / url.java
Created October 4, 2012 12:08
url参数含中文,乱码
name = new String(name.getBytes("ISO8859-1"),"UTF-8");
@MaySnow
MaySnow / home.html
Created October 3, 2012 09:21
公用的jsp页面
<jsp:include page="include/top.jsp">
<jsp:param value="new" name="tag"/>
</jsp:include>
@MaySnow
MaySnow / gist:3824749
Created October 3, 2012 03:14
eclipse|myeclipse 中如何清除断点
点击Window--->show View-->Debug-->Breakpoints点击
在出现的breakpoints界面中如果有内容证明有断点 否则没有没有断点
如果有断点:直接点击右键 删除所有断点(Remove ALL)即可。
@MaySnow
MaySnow / table.html
Created October 2, 2012 04:18
合并表格
<table>
<th>
<td>1</td>
<td>2</td>
<td>3</td>
</th>
<tr>
<td colspan = "2" >a</td>
<td>b</td>
@MaySnow
MaySnow / click.js
Created October 1, 2012 03:25
点击页面任意地方触发的事件
$(document).mousedown(function(){
//要做的事件
});
@MaySnow
MaySnow / vertical.css
Created October 1, 2012 00:46
位于表格的左上角,表格扩大,依旧位于左上角,不改变
text-align: left;
vertical-align: top;
@MaySnow
MaySnow / num.html
Created September 29, 2012 15:31
Jquery 获得 div层下子元素的个数
$(div).children().length