I just want to call function for custom elements in VBscript. following are my current script code. but its crashing my application. (target browser is 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
any idea why above code crashing
I found that above code will support only in IE 9. other versions of IE wont support this. Need to add following tag in htm file for supporting above code
“meta http-equiv=”X-UA-Compatible” content=”IE=9″ “
This solved my issue