function img1(object) 

imag1=object.src; 

上面那是客户端的代码.
而<%= imag1%>是服务器端代码.
可以这样写啊.
function img1(object) 

imag1=object.src; 
document.write(imag1);
}

解决方案 »

  1.   

    <img id=mm src="..."><input type=button value=ok onclick="alert(document.images('mm').src)">
      

  2.   

    我的问题很简单,怎么样让下面的Imag1在layer1中显示正确路径.谢谢!!!!
    <body>
    <script language="JavaScript" >
    function  img1(object)    
    {    
    imag1=object.src;    

    </script>
    <div id="Layer1" style="position:absolute; left:294px; top:112px; width:148px; height:67px; z-index:1"> 
    <%= imag1%>
     </div><table width="136" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutDefaultTable-->
      <tr>
        <td height="109"></td>
        <td valign="top"><img src="gy/lmb.JPG" width="154" height="200" onMouseOver="img1(this)"></td>
      </tr>
    </table>
    </body>