gpt4 book ai didi

需要 VBScript 对象

转载 作者:行者123 更新时间:2023-12-03 06:31:47 25 4
gpt4 key购买 nike

Option Explicit 
Dim output, ProxyEnable, ProxyServer, wshShell, doc

Sub Window_onLoad
loadProxySettings()
End Sub

Set wshShell = CreateObject("WScript.Shell")
ProxyEnable = wshShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable")
ProxyServer = wshShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer")

Function loadProxySettings()
If ProxyEnable = 1 Then
proxyStatus.className = "enabled"
proxyStatus.innerHTML = "Proxy aktiv"

toggleProxyButton.value = "Proxy deaktivieren"

proxyServer.value = ProxyServer
Else
proxyStatus.className = "disabled"
proxyStatus.innerHTML = "Proxy deaktiviert"

toggleProxyButton.value = "Proxy aktivieren"

proxyServer.value = ProxyServer
End If
End Function

只是找不到问题,为什么这给了我错误:

Object required "ProxyStatus"

(是的,我有一个 span 元素,其 idproxyStatus)

最佳答案

返回this code

Set ProxyStatus = document.getElementById("proxyStatus")
Set ToggleProxyButton = document.getElementById("toggleProxy")
Set ProxyServerInput = document.getElementById("proxyServer")

只要 HTML 格式正确,这里唯一的错误是当您仅引用 DOM 中的现有对象时使用 Set。尝试从这些行中删除 Set,如下所示;

ProxyStatus = document.getElementById("proxyStatus")
ToggleProxyButton = document.getElementById("toggleProxy")
ProxyServerInput = document.getElementById("proxyServer")

关于需要 VBScript 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35639540/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com