View Full Version : Pass Value to db using javascript

07-03-2003, 12:12 AM

I am pretty new to javascript and come from an asp background. I was curious to know if you could pass a value to a database return the results all using javascript?

If so could you possibly post some example code?

Any help would be greatly appreciated!


07-03-2003, 01:35 AM
If you mean client-side javascript, then the answer is no, directly it's not possible, since JavaScript in a client-side script can't open a database connection (to your server). You can send requests and even fetch whole pages with JS, and these pages could contain results of a DB query. But the real data retrieval would still be done by a server-side script.