考虑换个方法:
<img id="imgcon" width='120' height='160' border='0' />
var img = document.getElementById("imgcon");
img.src = path;
img.display = "block";另外留意一下你的path,因为FF下可能需要写的更标准
<img id="imgcon" width='120' height='160' border='0' />
var img = document.getElementById("imgcon");
img.src = path;
img.display = "block";另外留意一下你的path,因为FF下可能需要写的更标准
width="120" height="160" border=0></td>
function getImagePath(path)
{
alert(document.getElementById("userImage"))
var img=document.getElementById("userImage");
img.src="file:///C|/mlab3/exploded/images/favicon.ico";//"file:///"+path;
img.display = "block";
alert(document.getElementById("userImage").src)
// alert(document.getElementsByName("userImage")[0].src)
//var aa=document.getElementByID("userImage");
// aa.
// document.write("<img src='"+path+"' width='120' height='160' border=0/>")
//document.getElementById("imageDiv").innerHTML="<img src='"+path+"' width='120' height='160' border=0/>" ;
//alert(document.getElementById("imageDiv").innerHTML) //aa.setAttribute('src', path); }这样写不行呢!!!1请大家帮忙看一下.
function getImagePath(path)
{
alert(document.getElementById("userImage"))
var img=document.getElementById("userImage");
img.src=path
img.display = "block";
alert(document.getElementById("userImage").src)
// alert(document.getElementsByName("userImage")[0].src)
//var aa=document.getElementByID("userImage");
// aa.
// document.write("<img src='"+path+"' width='120' height='160' border=0/>")
//document.getElementById("imageDiv").innerHTML="<img src='"+path+"' width='120' height='160' border=0/>" ;
//alert(document.getElementById("imageDiv").innerHTML) //aa.setAttribute('src', path); }
</script>
<input onclick="getImagePath('http://dotnet.aspx.cc/Images/logoSite.gif')" type=button value=setImage/>