如何使用java Script连接sql server数据库和html5 web应用程序?
问题描述:
如何使用java Script连接sql server数据库和html5 web应用程序?
How to connect with sql server database and html5 web application using java Script?
答
数据库操作在服务器端工作。您可以使用JS与服务器端进行交互。就是这样。
Database operations work at server side. You can use JS to interact with server side. That is it.
JavaScript用于客户端脚本,它无法连接到数据库。但是,您可以使用Ajax将客户端请求传递到服务器端脚本,如php,jsp或.net code-bebind,后者又连接到数据库以进行任何数据库操作,其结果将被传回通过服务器端脚本访问您的Ajax脚本。
参考: AJAX简介 [ ^ ]
您可以询问Google提供有关使用特定服务器端脚本执行Ajax的更多信息。
JavaScript is for client-side scripting, it cannot connect to the database. However, you can use Ajax to convey client-side request to the server-side scripting like php, jsp, or .net code-bebind, which in turn connect to the database for any database operations, the result of which will be passed back to your Ajax script through the server-side script.
Refer: AJAX Introduction[^]
You can ask Google for more info on Ajax implementation with specific server-side scripting.