java web 学习杂记

1、标签可以嵌套。href="#" 这样可以以手型链接显示。中间的内嵌js代码与外部写的showPic()的js函数一样。

<td><a href="#" onclick='javascript:$(function showPic(){

window.showModalDialog("showImage.jsp?id=1&name=<%=fileList[i]%>","newwindow","height=1300, width=1300, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"); })'>  这是数据</a></td>

上面js的代码,与下面功能完全一样。

<script type="text/javascript">
function showPic(){
window.showModalDialog("showImage.jsp?id=1&name=<%=fileList[i]%>","newwindow","height=1300, width=1300, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no");
}
</script>

2、前台显示图片时,应该用图像的地址链接。(http://url)

     后台处理图片的时候,应该用图片的服务器相对或者绝对路径。

猜你喜欢

转载自blog.csdn.net/qq_16568205/article/details/54340539