下面这段源码 保存为.html的文件浏览图片的时候就可以 看到 图片,可是将主要的代码加到 .jsp页面里面 图片就 无法显示缩图,请高手指点啊!!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>档案添加</title>
<link href="../css/body.css" rel="stylesheet" type="text/css" />
<script language="javascript" >function dothis(){
document.getElementById("myimg").src = document.getElementById("abc").value;
}
function dothis1(){
document.getElementById("myimg").src = "";}
</script>
</head>
<body>
<div style="height:30px; width:200px; border:#CCCCCC 1px solid; float:left;">
<input type="button" class="buttonI" value="查找照片" onmousemove="abc1.style.pixelLeft=event.x-60;abc.style.pixelTop=this.offsetTop;" onclick="abc.click()"/>
<input type="file" id="abc" onChange="dothis()" name="abc1" style="position:absolute;filter:alpha(opacity=0);" size="1" hidefocus>
<input type="button" class="buttonI" value="清除照片" onclick="dothis1()"/>
</div>
<div style="height:170px; width:200px; border:#CCCCCC 1px solid; float:left; clear:both;">
<img id="myimg" src="" style="width:100%; height:100%;"/>
</div>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>档案添加</title>
<link href="../css/body.css" rel="stylesheet" type="text/css" />
<script language="javascript" >function dothis(){
document.getElementById("myimg").src = document.getElementById("abc").value;
}
function dothis1(){
document.getElementById("myimg").src = "";}
</script>
</head>
<body>
<div style="height:30px; width:200px; border:#CCCCCC 1px solid; float:left;">
<input type="button" class="buttonI" value="查找照片" onmousemove="abc1.style.pixelLeft=event.x-60;abc.style.pixelTop=this.offsetTop;" onclick="abc.click()"/>
<input type="file" id="abc" onChange="dothis()" name="abc1" style="position:absolute;filter:alpha(opacity=0);" size="1" hidefocus>
<input type="button" class="buttonI" value="清除照片" onclick="dothis1()"/>
</div>
<div style="height:170px; width:200px; border:#CCCCCC 1px solid; float:left; clear:both;">
<img id="myimg" src="" style="width:100%; height:100%;"/>
</div>
</body>
</html>
解决方案 »
- C3P0 DEBUG -- CLOSE BY CLIENT STACK TRACE
- Applet的连接的问题
- 如何在JSP页面之间传递 数组 呢?
- 关于hibernate一个奇怪的问题。。急求
- jsp中URL中文传递问题
- 弹出窗口位置问题,请大家帮忙解决!
- 求一个3位整数们最多两位小数位的浮点型正则表达式?
- 多表连接查询问题,帮忙找一下错误,急!
- 用ajaxfileupload+struts2上传出现空指针异常!求助!!
- 第一个JSP程序,运行出错,请大家帮忙,在线等待?
- 『急』org.hibernate.PropertyNotFoundException
- 急啊~~~~~~~~~~~~~~~~~~org.apache.jasper.JasperException
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'aa.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function dothis(){
document.getElementById("myimg").src = document.getElementById("abc").value;
}
function dothis1(){
document.getElementById("myimg").src = "";
}
</script>
</head> <body>
<div
style="height: 30px; width: 200px; border: #CCCCCC 1px solid; float: left;">
<input type="button" class="buttonI" value="查找照片"
onmousemove="abc1.style.pixelLeft=event.x-60;abc.style.pixelTop=this.offsetTop;"
onclick="abc.click()" />
<input type="file" id="abc" onChange="dothis()" name="abc1"
style="position: absolute; filter: alpha(opacity = 0);" size="1"
hidefocus>
<input type="button" class="buttonI" value="清除照片" onclick="dothis1()" />
</div>
<div
style="height: 170px; width: 200px; border: #CCCCCC 1px solid; float: left; clear: both;">
<img id="myimg" src="" style="width: 100%; height: 100%;" />
</div>
</body>
</html>我在jsp下也可以啊!
哎!
只不过他的IE是6.0的,我的IE7 ,但是我觉得应该与他无关,要不为什么我的.html的可以显示呢?
那位大侠知道原因呢?