<script language="JavaScript" >
function aaa(){
document.getElementById('imgmap').src="servlet/Mapservice?rqutype=panmap&centerx=113.983&centery=22.690";}
</script>
<body>
<img src='1.jpg' id='imgmap'>  <input type="button" name="aaaa" value="aaaa" onclick="aaa()">
</body>

解决方案 »

  1.   

    "imgmap"是servlet处理后返回的图片,<img id="imgmap" GALLERYIMG="false" style="position:absolute;left:0px;top:0px;height:520px;width:610px;cursor:default">
      

  2.   

    <script language="JavaScript" >
    function aaa(){
    document.getElementById('imgmap').src="servlet/Mapservice?rqutype=panmap&centerx=113.983&centery=22.690";}
    </script>
    <body>
    <img id="imgmap" GALLERYIMG="false" style="position:absolute;left:0px;top:0px;height:520px;width:610px;cursor:default">  <input type="button" name="aaaa" value="aaaa" onclick="aaa()">
    </body>
      

  3.   

    如果你是用servelt来生成图像,可以直接用这个代码 :
    <img src="<%=servlet/Mapservice?rqutype=panmap&centerx=113.983&centery=22.690%>"></img>如果你是想单击按钮后生成图片就在单击按钮的时候跳转到另一个页面,在另一个也面写上上面的代码就可以了
      

  4.   

    为什么我写成javascript形式就是不行呢?