html中的js代码怎么放进js文件中,格式

2025-06-23 05:45:01
推荐回答(1个)
回答1:

function addItem() {
var obj = new ActiveXObject("WScript.Shell");
obj.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\TestValue", "1", "REG_SZ");
document.writeln("Written successfully
");
var testValue = obj.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\TestValue");
document.writeln("Read successfully
");
document.writeln("The value of TestValue is "+testValue);
}
保存为js文件,在html文件中写入代码