如何通过JavaScript访问数据库?数据库、JavaScript

2023-09-10 20:13:29 作者:Cold-blooded 凉薄

我创造,我已经多次textboxes.when我在一个文本框中输入用户ID我想在接下来的文本框中显示的用户名时,管理员将移动到下一个文本box.for这是我可以用一个管理页面 AJAX 的JavaScript ?哪一个会更好?我怎么可以通过JavaScript做到这一点。

I am creating one admin page where I have multiple textboxes.when I enter the userid in one textbox I want to display user name in next textbox when admin moves to next text box.for this I can use ajax or javascript? which one will be better?how can I do it through javascript.

推荐答案

您无法直接通过JavaScript访问数据库。

You cannot access the DB directly through Javascript.

您可以使用AJAX调用服务器端(如PHP)的网页,查询数据库,虽然

You can use AJAX to call a serverside (e.g. PHP) page that queries the DB though