Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ReferenceError:ActiveXObject未在Chrome和Mozilla中定义_Javascript_Google Chrome_Firefox_Activexobject_Referenceerror - Fatal编程技术网

Javascript ReferenceError:ActiveXObject未在Chrome和Mozilla中定义

Javascript ReferenceError:ActiveXObject未在Chrome和Mozilla中定义,javascript,google-chrome,firefox,activexobject,referenceerror,Javascript,Google Chrome,Firefox,Activexobject,Referenceerror,我在尝试解决引用错误时遇到了很多困难: Google Chrome中未定义ActiveXObject 知道从哪里开始吗?那是因为谷歌浏览器和Mozilla Firefox(以及微软Edge)不支持ActiveXObject,而且从来没有,也永远不会。ActiveX在现代web浏览器中没有一席之地 只有IE支持ActiveXObject,即使如此,IE的最新版本也只支持对象子集(我不认为FileSystemObject是其中之一) 至于从网页在本地机器的文件系统上创建文本文件:不,你不能这样做。(

我在尝试解决引用错误时遇到了很多困难:

Google Chrome中未定义ActiveXObject


知道从哪里开始吗?

那是因为谷歌浏览器和Mozilla Firefox(以及微软Edge)不支持
ActiveXObject
,而且从来没有,也永远不会。ActiveX在现代web浏览器中没有一席之地

只有IE支持
ActiveXObject
,即使如此,IE的最新版本也只支持对象子集(我不认为
FileSystemObject
是其中之一)

至于从网页在本地机器的文件系统上创建文本文件:不,你不能这样做。(旧版本IE中禁用安全性的情况除外。)

function WriteToFile()
{
  var fso = new ActiveXObject("Scripting.FileSystemObject");
  var s = fso.CreateTextFile("/var/www/html/nodejsphp/Test.txt",true);
  s.WriteLine('messages');
  console.log("contents of file now'some sampletext'");
  s.Close();
}