<p><img id="pic1" src="csdn.gif" width="100" height="50" onclick=savepic()>点击另存[要在同一域]</p>
<script>
function savepic(){
if(document.all.a1==null) {
objIframe=document.createElement("IFRAME");
document.body.insertBefore(objIframe);
objIframe.outerHTML= "<iframe name=a1 style='width:0;hieght:0' src="+pic1.src+"></iframe>";
re=setTimeout("savepic()",1)
} else {
clearTimeout(re)
pic = window.open(pic1.src,"a1")
pic.document.execCommand("SaveAs")
document.all.a1.removeNode(true)
}
}
</script>
<script>
function savepic(){
if(document.all.a1==null) {
objIframe=document.createElement("IFRAME");
document.body.insertBefore(objIframe);
objIframe.outerHTML= "<iframe name=a1 style='width:0;hieght:0' src="+pic1.src+"></iframe>";
re=setTimeout("savepic()",1)
} else {
clearTimeout(re)
pic = window.open(pic1.src,"a1")
pic.document.execCommand("SaveAs")
document.all.a1.removeNode(true)
}
}
</script>
解决方案 »
- swfUpload post_params参数传递问题
- 请大侠们帮我指点下迷津
- 在线等:struts2的redirect-action会遗传?
- 简单sql 求max
- 怎样让弹出的确认对话框显示在所有程序上面?
- Servlet中文问题
- [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序 ??求助啊
- JSP错误,请指教
- javabean封装sqlserver2000的问题
- resin中的session问题(基于struts结构)~~~急~~~
- 哪位大哥知道像chinaren里边的校友录中的图片缩放是咋做地?
- 采用Jsp从数据库中取得数据,来生成XML文件,进行存储,应该如何做?
谢谢!
可是,我并不是要存整个页面,我只是要得到客户定义的文件名和路径,然后由JAVASCRIPT按照得到文件名和路径创建文件并写入我想写的东西。您给我的代码是会存入整个页面吧?能否存入我想存的东西呢?我要存的文件必需要一行一行地写入。