<SELECT NAME="select" onChange="change();">
<option value="">1</option>
<option value="">2</option></SELECT>
<td align="center" width="100"><img width="100" name="img1" id="img1" src="D:\乖猫.jpg"></td>
<script>
function change(){
document.getElementById("img1").src="D:\晕.JPG";
}
</script>
<option value="">1</option>
<option value="">2</option></SELECT>
<td align="center" width="100"><img width="100" name="img1" id="img1" src="D:\乖猫.jpg"></td>
<script>
function change(){
document.getElementById("img1").src="D:\晕.JPG";
}
</script>
图片本来就在服务器上了,难道要再从客户端传回来?
地址就放在下拉框的option的value里面,作为字符串就传回来了。
String paths=“e:/abc”;
String fileName=“file1.gif”;
File path=new File(paths);
FileInputStream f1=new FileInputStream(path,fileName);
if(path.exist())//目录存在{
if(f1.exist()){
//业务逻辑代码
}
else{
if(path.isDirectory()){
//是目录。
}else
{
//出错处理。
f1.createNewFile(fileName);//创建新文件
//业务逻辑代码
}
int length=f1.available();
if(length==0) //为空
return;
f1.read(length);
//记不得了。。查查资料 吧。
}
}