Javascript (at least in a browser) does not provide socket support (hence the use of an ActiveX object in the example you cited). Nor does it have the low-level type conversions that would be required for implementing a client. So even if you were to work out the mysql protocol (see mysqlproxy as well as myqld and the standard client libs).
So unless you want to write your own browser, you'll need to think about some sort of bridge between javascript and mysql.
A further issue is that most people wouldn't want to give direct DML facilities at the client - so even if you're currently connecting across a VPN, then you need to spend a significant amount of time thinking about authentication and session management.
There's some discussion about database abstraction here and in other places.
If it were me I'd be thinking about AJAX/JSON from javascript to the bridge, bridge running somewhere close to the mysql DBMS and implemented in a language with native mysql support (e.g. Perl, PHP) which provides for session support over HTTP.
HTH