<input name=f id=f type=file onchange="document.getElementById('t').value=this.value">
<img src="..." onclick="document.getElementById('f').click()" style="cursor:hand;">
<input name=t id=t readonly>
<img src="..." onclick="document.getElementById('f').click()" style="cursor:hand;">
<input name=t id=t readonly>
<img onclick=loadFile()>
<script>
function loadFile()
{
var e = document.createElement("input");
e.type="file";
document.body.appendChild(e);
e.click();
eval("filename").value=e.value;
}
</script>
<img onclick=loadFile()>
<script>
function loadFile()
{
var e = document.createElement("input");
e.type="file";
document.body.appendChild(e);
e.click();
eval("filename").value=e.value;
document.body.removeChild(e);
}
</script>
因此任务不可能完成,如果可以的话,IE 就是黑客软件了!<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style>
.uploadFile {
visibility: hidden;
}
</style>
</head><body>
<form name="Form1" method="post" action="ImageUploaderTester.aspx" id="Form1">
<input type="image" id="uploadImage" src="" alt="Upload">
<input type="text" id="uploadFilePath" readonly size="80">
<input type="file" id="upload" class="uploadFile" width="0px">
<script language="JavaScript">
<!--
var upload = document.getElementById("upload");
var uploadFilePath = document.getElementById("uploadFilePath");
var uploadImage = document.getElementById("uploadImage");
uploadImage.onclick = function()
{
upload.click();
// 每 0.5 秒扫描一次。
this.iTimeoutId = window.setInterval(CheckChange,250); return false;
}function CheckChange()
{
if(upload.value != uploadFilePath.value)
{
uploadFilePath.value = upload.value;
}
}
//-->
</script>
</form>
</body>
</html>
<div style="position:absolute;top:15;left:-80;width:150;filter:alpha(opacity=0); opacity: 0; -moz-opacity: 0; -khtml-opacity: 0;" >
<input type="file" onchange="document.getElementById('mm').value=this.value" size="33"></div>