<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 %>