考虑换个方法:
<img id="imgcon" width='120' height='160' border='0' />
var img = document.getElementById("imgcon");
img.src = path;
img.display = "block";另外留意一下你的path,因为FF下可能需要写的更标准

解决方案 »

  1.   

    ff 没报什么错,就是不显示.IE是可以的.
      

  2.   

    <td rowspan="2"><img id="userImage" src=""
                                                        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请大家帮忙看一下.
      

  3.   

    是可以的,90%是路径问题<img id="userImage" src="" width="120" height="160" border=0><script>
     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/>
      

  4.   

    哦,我是要显示本地的图片,不是那种url的.