1、图片下载
//设置内容为流格式
response.setContentType("application/octet-stream");
//添加文件长度
response.addHeader("Content-Length", "" + file.length());
response.setHeader("Content-Disposition","attachment;filename=file.jpg");
当设置ContentType为“response.setContentType("image/jpeg");”时,电脑端可以识别,手机端并不能全部正常识别。
2、删除对象发生错误
error:deleted object would be re-saved by cascade (remove deleted object from asso错误
http://blog.163.com/weizonghua_2006/blog/static/13106065620108113618639/
ps:先删除many,再删除one
3、日志记录 最低级别是 debug
DEBUG < INFO < WARN < ERROR
4、c:forEach循环
<c:forEach var="ticketDiscount" items="${ticket_discount}" begin="i" end="i">
${ticketDiscount.name}
</c:forEach>
5、js判断checked
if
(
isauto_sell
.
prop
(
'checked'
)){
//勾选
}else{
//没勾选
}
6、jquery绑定事件
<div
class
=
"2"
></div>
</div>
delegate、 on
$(".3").on('click','.2;',function(){
alert(1);
})
7、js获取iframe中的内容
<iframe
class
=
"ke-edit-iframe"
>
<div
class
=
"ke-content"
>
fdafasd
</div>
</iframe>
var cont = $(".ke-edit-iframe").contents().find(".ke-content").html();
8、创建序列 postgresql
create sequence send_sms_attendance_sequence increment by 1 minvalue 1 no maxvalue start with 1;
9、js刷新当前页面
var
win
=
art
.
dialog
.
open
.
origin
;
//来源页面
win.location.reload();
10.art.diaog.open使用
art.dialog.open("/eventSet/toTheaterAreaSet?eid="+$('#eid').val(), {title:"关联剧场区域",drag: false,fixed: true,lock: true,opacity: 0.3, close: function() { if(setTheaterAreaNum == 0) { var win = art.dialog.open.origin;//来源页面 win.location.reload(); setTheaterAreaNum = 1; } else { setTheaterAreaNum = 0; } }});
1.对象就是传引用
2.原始类型就是传值 byte short int long float double boolean char
3.String类型因为没有提供自身修改的函数,每次操作都是新生成一个String对象,所以要特殊对待。可以认为是传值。
2.原始类型就是传值 byte short int long float double boolean char
3.String类型因为没有提供自身修改的函数,每次操作都是新生成一个String对象,所以要特殊对待。可以认为是传值。
12、社交网络分享插件
<div
class
=
"bdsharebuttonbox"
style
=
"
display
:
none
;
"
>
<a
href
=
"#"
class
=
"bds_more"
data-cmd
=
"more"
style
=
"
display
:
none
"
></a>
<a
href
=
"#"
class
=
"bds_tsina"
id
=
"shareToSina"
data-cmd
=
"tsina"
title
=
"分享到新浪微博"
></a>
<a
href
=
"#"
class
=
"bds_tqq"
id
=
"shareToQq"
data-cmd
=
"tqq"
title
=
"分享到腾讯微博"
></a>
<a
href
=
"#"
class
=
"bds_renren"
id
=
"shareToRenren"
data-cmd
=
"renren"
title
=
"分享到人人网"
></a>
<a
href
=
"#"
class
=
"bds_kaixin001"
id
=
"shareToKx"
data-cmd
=
"kaixin001"
title
=
"分享到开心网"
></a>
</div>
<script>
window
.
_bd_share_config
={
"common"
:{
"bdSnsKey"
:{},
"bdText"
:
"家有购物"
,
"bdUrl"
:
"www.jyh.com"
,
"bdMini"
:
"2"
,
"bdMiniList"
:
false
,
"bdPic"
:
""
,
"bdStyle"
:
"1"
,
"bdSize"
:
"16"
},
"share"
:{
"bdText"
:
""
,
"bdUrl"
:
""
}};
with
(
document
)
0
[(
getElementsByTagName
(
'head'
)[
0
]||
body
).
appendChild
(
createElement
(
'script'
)).
src
=
'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='
+~(-
new
Date
()/
36e5
)];
</script>
修改
window._bd_share_config.share.bdText = content;
window._bd_share_config.share.bdUrl = url;
达到修改分享内容与链接的效果。默认分享内容为当前title,分享链接为当前链接。
建议:将自带div隐藏,单独设计分享图标,再通过模拟点击自带的图标,点击效果需要用纯js实现,jquery点击无效。
13、当页面上存在form时,刷新页面时浏览器可能会弹出提示框。
14、top.postmessage window.message 向上级传送信息
15、js中if(str),判断str是不是一个对象,是对象之后继续其它判断。
16、setTimeout
setTimeout里的方法需以 function(){}包围,才可顺利执行。
1904

被折叠的 条评论
为什么被折叠?



