You'll need php, or another server executed language. Even if it were possible, it would be utterly stupid to use. In that case, you would need to give the database information to the users, which is stupider than giving a locker with all your precious possessions, to a complete stranger, and not locking it.Even if you could hide your information, it would still be quite easy to tamper with the data, and it would probably take 5 minutes, before your whole database is truncated, or somehow else messed up. The answer is an obvious no.
Find Out AJAX Tutorials & Samples, They Will Help. You Can Use COMPLETE DATABASE Handling With AJAX. AJAX & JQUERY are Advanced Version Of JAVASCRIPT.
This is done regularly using AJAX and is a process that is not at all uncommon within many of today's web apps.
As ssmm987 said, getting data directly from the database with javascript alone is impossible and even if it was it would pose a great security risk. On the other hand you can use PHP to get the data from the database and then use Javascript to get the data from the PHP file. It's not the same as getting the data directly from the database but to the user it looks the same, because the page doesn't reload. The methods that allow this to happen are programmed is javasript and are called AJAX.
If you meant directly from a database, through javascript alone, then Yes it is possible. If you have a database on your computer and run a a javascript locally. This would be useful only for creating scripts for local database maintenance. It would also be useful when run over a local network.
Actually Database is in server side and your Java Script is in Client Side so you can't get the value. But you can do it by using Ajax concept where you can get server response by sending request through srcipt.
A database can be either. As I said before, Javascript CAN connect to a database locally... but only when run locally as a script, on the same machine as the database... A database is merely a file, it's whether or not you have the permission to access it..
It is interresting. Please can you show me a code which do that? I suppose you don't wanna use cookies, arrays etc. I think there is no way how to connect with common browsers directly to RDBMS like Oracle, Sql Server, MySQL... Only one way which I know is ActiveX, which is available only at IE with low level security options or with FF when people have installed special plugin. Thanks
http://bytes.com/topic/javascript/answers/532398-connect-access-database-using-javascript you can connect to any database as long as the driver for it is installed on the system it is run on..
But only with ActiveX which are not commonly supported in default behavior of browsers... So IMHO is the best practise use server side script to connect into database.
the answer is "YES" you can use AJAX technology where javascript calls for php function behind the scene - where you access your database
I completely agree, but it is possible. Could be useful for local database maintenance, reporting etc. Non-commercial type things...