onclick='showthread(); myjsfunction()' language='vbscript'>
somewhat to the effect of the above but does not work. Where showthread is a vbscript function and myjsfunction is a javascript function.
Thank you.
It seems to me your best bet is to abandon onxyz handlers and hook things up properly via the DOM — or a combination of the two.
For instance, your element could hook up the VBScript via onxyz (I've copied your syntax for that):
<div id="mydiv" onclick="showthread();" language="vbscript">
...and a <script> tag in the document could hook up the JavaScript:
<script>
document.getElementById("mydiv").attachEvent("onclick", myjsfunction);
</script>
(I'm using attachEvent there because I know you're using an IE-based engine, if you're using VBScript.)
Or of course, have two <script> elements (one JavaScript and one VBScript) and hook up both functions via the DOM:
<div id="mydiv">
<script>
document.getElementById("mydiv").attachEvent("onclick", myjsfunction);
</script>
<script type="application/x-vbscript">
document.getElementById("mydiv").attachEvent "onclick", showthread
</script>
(Or whatever the correct MIME type is for VBScript. Or you can probably use language="VBScript" with an IE-based engine.)
getElementById, getElementsByTagName, the rows property... Or, of course, since the click event bubbles, just hook it on the table or tbody element and refer to event.target.I'm not very familiar with VBScript but it seems to me that you could do something like
function myjsfunction() {
window.location = "vbscript:showthread();"
// other JS code
}
to call the VBScript function from JS. This is certainly hacky but I don't know of any better way.
If it's possible, though, it's probably best to convert to JavaScript entirely.
onclickto call a single JS function, and from that function call your VB function. That's how I remembered it working the last time I did this, which was a long time ago, but also I just tried it and it worked (in IE8). @polin - OP has already said what is required. This is all client-side.