复制代码代码如下:
<!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">
<head>
<title> downloadify </title>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<style type = "text/css" media = "screen">
ボディ{背景:#fff;幅:500px;マージン:20px auto;}
input、textarea、p {font-family:宋体、黑体; font-size:12pt;}
input、textarea {border:solid 1px #aaa;パディング:4px;幅: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.js"> </script> - >
<script type = "text/javascript">
window.load = function(){
downloadify.create( 'downloadify'、{
ファイル名:function(){
document.getElementById( 'filename')。value;
}、
データ:function(){
document.getElementById( 'data')。valueを返します。
}、
oncomplete:function(){alert( '成功保存文件!'); }、
oncancel:function(){alert( '您已经取消保存文件'); }、
onerror:function(){alert( '出现错误了'); }、
swf: 'js/downloadify.swf'、
downloadimage: 'js/download.png'、
幅:100、
高さ:30、
透明:本当、
追加:false
});
}
</script>
</head>
<body onload = "load();">
<入力型= "text" name = "filename" value = "文件名txt" id = "filename" /> <br />
<Textarea cols = "60" rows = "10" name = "data" id = "data">文件内容</textarea>
<p id = "downloadify">このファイルをダウンロードするにはフラッシュ10がインストールされている必要があります。</p>
</body>
</html>