Home > Web Front-end > JS Tutorial > javascript save file to local implementation method_javascript skills

javascript save file to local implementation method_javascript skills

WBOY
Release: 2016-05-16 17:47:39
Original
1470 people have browsed it

Both forms are available
The first one:

Copy code The code is as follows:

<script> <br>function SaveAs5(imgURL) <br>{ <br>var oPop = window.open(imgURL,"","width=1, height=1, top=5000, left=5000 "); <br>for(; oPop.document.readyState != "complete"; ) <br>{ <br>if (oPop.document.readyState == "complete")break; <br>} <br> oPop.document.execCommand("SaveAs"); <br>oPop.close(); <br>} <br></script>


Second type:
Copy code The code is as follows:

<script> <br>function SaveAs5(imgURL) <br>{ <br>var oPop = window.open(imgURL,""," width=1, height=1, top=5000, left=5000"); <br>for(; oPop.document.readyState != "complete"; ) <br>{ <br>if (oPop.document.readyState == "complete")break; <br>} <br>oPop.document.execCommand("SaveAs"); <br>oPop.close(); <br>} <br></script>

Click here to download the image
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template