document.write("<img src='" + fileName + "' id='img1' name='img1' width=144px height=115px onclick = 'alert(img1.src)'/>");

解决方案 »

  1.   

    for(var i=0 ; i<fileNames.length ; i++) {
        fileName = fileNames[i];
        document.write(" <td> ");
        document.write(" <a href=""> ");
        document.write("<img onclick='alert(this.src)' src='" + fileName + "' width=144px height=115px/>");
            document.write("</a>");            
    }
      

  2.   

    for(var i=0 ; i <fileNames.length ; i++) { 
        fileName = fileNames[i]; 
        document.write(" <td> "); 
        document.write(" <a href=""> "); 
        document.write(" <img onclick='getImageSrc(this)' src='" + fileName + "' width=144px height=115px/>"); 
            document.write(" </a>");            

    function getImageSrc(img)
    {
       var test=img.src;
       alert(test);
    }
      

  3.   

    TMD什么机顶盒的破浏览器?
    我写成这样,取不出来~~for(var i=0 ; i <fileNames.length ; i++) { 
        fileName = fileNames[i];  
        document.write("<img src='" + filePath + "' width=144px height=115px onclick='getImageSrc(this)'");           
    } function getImageSrc(img) 

      var test=img.src; 
      alert(test); 

    我写成这样,还是取不出来~~for(var i=0 ; i <fileNames.length ; i++) { 
        fileName = fileNames[i];  
        document.write("<img src='" + filePath + "' width=144px height=115px onclick='getImageSrc(this.src)'");           
    } function getImageSrc(src) 

     // var test=img.src; 
      alert(src); 
    } 靠~~
    在IE都可以~~
    真TMD的烂浏览器~~~
      

  4.   

    机顶盒的浏览器????....................................
    同情ing,没搞过这中浏览器