日期:2014-05-19  浏览次数:20488 次

请问这样为什么不能实现啊?help me
a.html

<div   id= "div1 "> </div>
<iframe   id= "frame1 "   width= "0 "   height= "0 "> </iframe>
<input   name= "bt1 "   type= "button "   onclick= "document.getElementById( 'frame1 ').src= 'gettime.aspx '; "   />


gettime.aspx  

response.write( " <script> parent.document.getElementById( "div1 ").innerHtml   =   "+DateTime.Now.ToString()+ "; </script> ");

我一点bt1按钮   div1就显示服务器时间   类似不刷新


------解决方案--------------------
= "+DateTime.Now.ToString()+ "; </ ==> = ' "+DateTime.Now.ToString()+ " '; </
------解决方案--------------------
<div id= "div1 ">
</div>
<iframe id= "frame1 " width= "0 " height= "0 "> </iframe>
<input name= "bt1 " type= "button " value= "click " onclick= "document.getElementById( 'frame1 ').src= 'gettime.aspx ';return false; " />


Response.Write( " <script> parent.document.getElementById( 'div1 ').innerHTML = ' " + DateTime.Now.ToString() + " '; </script> ");
------解决方案--------------------
innerHtml -> innerHTML