---
title: "javascript 小技巧"
author: "q272156430"
date: "2009-04-01T10:27:25Z"
tags: []
slug: "javascript"
draft: false
lastmod: "2009-04-01T10:27:25Z"
id: 358794
url: "https://xiaolele.iteye.com/blog/358794"
---

```
<!-- 另存为图片 -->
                                    <input type="button" value="下载" onclick="download()"/>
                                    <iframe   src="../images/sm2.gif"   name="show"   style="width:0;height:0"></iframe>
                                    <script language="javascript">
                                    function download(){
                                       show.document.execCommand("SaveAs");
                                        }
                                    </script>
                                    <!-- 另存为图片 -->
```