我只想在 VBscript 中调用自定义元素的函数。以下是我当前的脚本代码。但它使我的应用程序崩溃。(目标浏览器是Internet Explorer)
Function SampleFunction()
msgbox"samplemessage"
End Function
set ResponseFn = getRef("SampleFunction")
set element = document.getElementById("elem id")
element.addEventListener "OnResponse, ResponseFn , false
set cEvent = document.createEvent("CustomEvent")
cEvent.initCustomEvent "OnResponse", false, false, null
element.dispatchEvent(cEvent)
element.removeEventListener "OnResponse\", ResponseFn , false
知道为什么上面的代码会崩溃