I know we can hook a few things inside JS using ActiveX, and from that link, this is the part I would concentrate on:
var clock = new ActiveXObject("Clocks.clock");
var extendedClockEvents = clock.ExtendedClockEvents();
// Here you assign (subscribe to) your callback method!
extendedClockEvents.ScriptCallbackObject = clock_Callback;
...
function clock_Callback(time)
{
document.getElementById("text_tag").innerHTML = time;
}
An example using FileSystemObject …
//Load ActiveObject Tools
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.FolderExists() ...
fso.CreateFolder() ...
And using ADODB (ODBC drivers for other DB Engines such as MySql) …
var conn = new ActiveXObject("ADODB.Connection");
var rs = new ActiveXObject("ADODB.Recordset");
conn.open = conString;
var sSQLStatement = "SELECT count(*) FROM art_articles";
rs.Open(sSQLStatement, conn);
EDIT: unfortunately, those examples initiate actions, they don’t create “listeners” which might be more what you are looking to do… not sure…