<div class="codetitle"> <span><a style="CURSOR: pointer" data="81205" class="copybut" id="copybut81205" onclick="doCopy('code81205')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code81205"> <br> <br> <br> <br><title>Downloadify</title> <br><meta http-equiv="content-type" content="text/html;charset=utf-8"> <br><style type="text/css" media="screen"> <BR>body {background: #fff; width: 500px; margin: 20px auto;} <BR>input, textarea, p { font-family: 宋体, 黑体; font-size: 12pt;} <BR>input, textarea { border: solid 1px #aaa; padding: 4px; width: 98%;} <BR></style> <br><script type="text/javascript" src="js/swfobject.js"></script> <br><script type="text/javascript" src="js/downloadify.js"></script> <br><!-- <script type="text/javascript" src="js/downloadify.min.js"></script> --> <br><script type="text/javascript"> <BR>window.load=function(){ <BR>Downloadify.create('downloadify',{ <BR>filename: function(){ <BR>return document.getElementById('filename').value; <BR>}, <BR>data: function(){ <BR>return document.getElementById('data').value; <BR>}, <BR>onComplete: function(){ alert('成功保存文件!'); }, <BR>onCancel: function(){ alert('您已经取消保存文件'); }, <BR>onError: function(){ alert('出现错误了'); }, <BR>swf: 'js/downloadify.swf', <BR>downloadImage: 'js/download.png', <BR>width: 100, <BR>height: 30, <BR>transparent: true, <BR>append: false <BR>}); <BR>} <BR></script> <br> <br> <br><input type="text" name="filename" value="文件名.txt" id="filename"><br> <br><textarea cols="60" rows="10" name="data" id="data">文件内容</textarea> <br><p id="downloadify">You must have Flash 10 installed to download this file.</p> <br> <br><br> </div>