has anyone experience with passing a parameter to a function called with getref ?
Following code is just an example, doens’t work, how to pass the parameter to the mySub sub?
<button id="myBtn">Click me</button>
<script type="text/vbscript">
document.getElementById("myBtn").onclick=GetRef("mySub")
Sub mySub(parameter)
alert(parameter)
End Sub
</script>
First look at this article about event handling (anybody knows a better reference?) to get the context for:
Then experiment with this .hta:
to see
WRT Salman A’s answer:
If you really need an error message like:
then you just have to add:
and
to the test .hta.
WRT Peter’s proposal – it pays to keep it simple:
output:
That you use the name of the variable set with GetRef() exactly as you use the literal Sub/Function name could have been established yesterday.