Ram*_*ani 18 javascript sencha-touch-2
我想在本地创建文本文件,当我浏览谷歌浏览器点击按钮它显示错误像 ActiveXObject没有定义,当我浏览safari点击按钮它显示错误,如 找不到变量:ActiveXObject.任何人都可以帮助我.我可以实现和创建文件.Thanq
<script>
function createFile() {
var object = new ActiveXObject("Scripting.FileSystemObject");
var file = object.CreateTextFile("C:\\Hello.txt", true);
file.WriteLine('Hello World');
alert('Filecreated');
file.WriteLine('Hope is a thing with feathers, that perches on the soul.');
file.Close();
}
</script>
<input type="Button" value="Create File" onClick='createFile()'>
Run Code Online (Sandbox Code Playgroud)
fca*_*ran 24
ActiveXObject仅适用于IE浏览器.所以每个其他的使用者都会抛出一个错误
在现代浏览器上,您可以使用File API或File writer API(目前仅在Chrome上实现)
| 归档时间: |
|
| 查看次数: |
176432 次 |
| 最近记录: |