复制代码代码如下:
<! DocType html public "-// w3c // dtd xhtml 1.0 Strict // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml: lang = "en">
<Evista>
<title> downloadify </title>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<style type = "text/css" media = "pantalla">
cuerpo {fondo: #fff; Ancho: 500px; Margen: 20px Auto;}
entrada, TextARea, P {Font-Family: 宋体, 黑体; tamaño de fuente: 12pt;}
entrada, TextAREA {Border: Solid 1px #AAA; relleno: 4px; Ancho: 98%;}
</style>
<script type = "text/javaScript" src = "js/swfobject.js"> </script>
<script type = "text/javaScript" src = "js/downloadify.js"> </script>
<!-<script type = "text/javaScript" src = "js/downloadify.min.js"> </script>->
<script type = "text/javaScript">
Window.load = function () {
Downloadify.create ('downloadify', {
nombre de archivo: function () {
devolver documento.getElementById ('nombre de archivo'). valor;
},
Data: function () {
return document.getElementById ('Data'). Value;
},
onComplete: function () {alert ('成功保存文件!'); },
onCancel: function () {alert ('您已经取消保存文件'); },
onError: function () {alert ('出现错误了'); },
SWF: 'js/downloadify.swf',
downloadImage: 'js/download.png',
Ancho: 100,
Altura: 30,
Transparente: Verdadero,
Agregar: falso
});
}
</script>
</ablo>
<Body Onload = "Load ();">
<input type = "text" name = "filename" value = "文件名 .txt" id = "nombre de archivo" /> <br />
<Textarea cols = "60" ROWS = "10" name = "data" id = "data"> 文件内容 </textarea>
<p id = "downloadify"> Debe tener Flash 10 instalado para descargar este archivo. </p>
</body>
</html>