当前位置: 代码迷 >> ASP >> 结果和预想的不同
  详细解决方案

结果和预想的不同

热度:126   发布时间:2012-10-10 13:58:11.0
结果跟预想的不同
<INPUT title=写入文件 onclick="<% writefile addurl,"map.html","gb2312" %>" type=button value=写入文件>

本意是点这个按钮的时候才运行 writefile 这个函数,但现在页面一打开就运行了,怎么修改?

------解决方案--------------------
HTML code
<INPUT title="写入文件" onclick="fwrite()" type="button" value="写入文件" />
<script type="text/javascript">
function fwrite(){
    if(confirm("确定要写入文件?")){
        location.href="?action=write";
    }
}
</script>
<%
if request.querystring("action")="write" then
    call writefile(addurl,"map.html","gb2312")
end if
%> 
  相关解决方案