ローカルでテキストファイルを作成したい場合は、Googleクロムでボタンをクリックするとエラーが表示されますActiveXObjectが定義されていません Safariボタンをクリックすると、のようなエラーが表示されます。変数:ActiveXObject。いずれかme.howは、私が達成しActiveXObjectが定義されていないため、変数を見つけることができません:ActiveXObject
<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()'>
IE上でさえ、HTTP経由で提供されるページからこれを行うと、セキュリティブロックを打つことになります。 –