1

我无法将数据从 IE 写入本地文件。我有下一个问题:当我创建带有下一个内容的 html 页面时

<html>
<head>
<title>File's saving</title>
  <SCRIPT>
function cf_random() {
b="c:\\file.txt";

var fso, f1; 
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.CreateTextFile(b, true);

f1.WriteLine("Testing") ;
document.writeln("File " + b + " is created.");
}
  </SCRIPT>


</head>
<BODY>
<input type=button value="Create file" onClick="cf_random()">
</body>
</html>

它工作得很好,但是当我尝试使用我使用书签附加到站点的 extern js 文件的相同代码时 - 我收到错误 SCRIPT429: Automation server can't create object(code bellow)

javascript: (function() {
    var s2 = document.createElement('script');
    s2.src = 'http://192.168.0.100/jquery.js';
    document.body.appendChild(s2);
})();

$(document).ready(function(){    
b="c:\\file.txt";
var fso, f1; 
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.CreateTextFile(b, true);
f1.WriteLine("Testing") ;
document.writeln("File " + b + " is created.");
});

有什么问题?

4

1 回答 1

1

我解决了这个问题。这只是保密设置。

于 2012-10-06T17:00:42.840 回答