You can't.
Not if you mean JavaScript in the browser.
You *could* use ASP and then use JScript (Microsoft's implementation of JavaScript) on the server. But that's a completely different thing.
************
I have to be honest and admit that *technically* you *can* use JavaScript in the browser to get data from a database, but:
(1) The browser user has to *allow* the use of components that are marked as "unsafe for scripting" (and they are! used wrong, they could wipe out things!).
(2) The browser user has to mark your site as a "trusted site".
(3) Depending on what kind of database you are talking about, you might still have enormously complex connection issues.
In short, even though it's theoretically possible, it's a really really bad idea. And probably won't work the way you want it to, anyway.
|