Here is a JavaScript example for event binding within a script. First,
here's a simple click handler:
function my_onclick() {
. . .
}
document.form.mybutton.onclick = my_onclick
Here's a more interesting window handler:
function my_onload() {
. . .
}
var win = window.open("some/other/URI")
if (win) win.onload = my_onload
In Tcl this looks like:
proc my_onload {} {
. . .
}
set win [window open "some/other/URI"]
if {$win != ""} {
$win onload my_onload
}