Writing to file in javascript. not working
问题 Hello i have had problems with my html/javascript code: function rf() { var fs,file; fs = new ActiveXObject('Scripting.FileSystemObject'); file = fs.OpenTextFile('/test123.txt',2); file.Write('The text to write to file'); file.Close(); } </script> <button onclick="rf()">Try it</button> </html> i go on the page, click the button, no success. can someone correct this for me? 回答1: Even Internet Explorer does not allow this construct by default, in any version - you'll need to manually switch