如何使用html5和javascript访问/插入服务器数据库?

时间:2022-09-26 08:56:02

I have to develop a website for mobile phones and I am using html5 and javascript. Can I access/insert into server database using html5 and javascript only without using asp, php or any other server side language.

我必须开发一个移动电话的网站,我正在使用html5和javascript。只能使用html5和javascript访问/插入到服务器数据库,而不需要使用asp、php或任何其他服务器端语言。

4 个解决方案

#1


2  

Yes it is. You will however need a backend database with a HTTP interface. One of which is MongoDB which has a REST interface.

是的,这是。但是,您需要一个具有HTTP接口的后端数据库。其中之一是MongoDB,它有一个REST接口。

More info here http://www.mongodb.org/display/DOCS/Mongo+Extended+JSON

更多信息在http://www.mongodb.org/display/DOCS/Mongo +扩展+ JSON

#2


1  

No, you can't, and if you could then you would be insane to do so as it would allow everybody to make arbitrary SQL queries.

不,你不能这样做,如果你能这样做,那你就疯了,因为这会让每个人都可以进行任意的SQL查询。

#3


0  

Html and Javascript are the Front end side languages, it not advisable to use those languages features to connect to database. Later it would be very tough to maintain it and enhance it.

Html和Javascript是前端语言,不建议使用这些语言特性来连接数据库。以后维护和增强它将会非常困难。

ALWAYS THINK IN FUTURE PERSPECTIVE, else your code becomes obsolete

总是从未来的角度考虑,否则你的代码就会过时

instead you can use any scripting language like php to connect to database. Since you wanted to create a website, obviously PHP and mysal will be always available to you at NO COST.

相反,您可以使用任何脚本语言,比如php来连接数据库。因为您想要创建一个网站,显然PHP和mysal将始终免费提供给您。

#4


0  

Use javascript and maybe you may not want to connect to mysql... Try .csv formats and excel... It's good if you are not storing sensitive information.

使用javascript,也许你不想连接到mysql……尝试.csv格式和excel…如果你不存储敏感信息,那就更好了。

#1


2  

Yes it is. You will however need a backend database with a HTTP interface. One of which is MongoDB which has a REST interface.

是的,这是。但是,您需要一个具有HTTP接口的后端数据库。其中之一是MongoDB,它有一个REST接口。

More info here http://www.mongodb.org/display/DOCS/Mongo+Extended+JSON

更多信息在http://www.mongodb.org/display/DOCS/Mongo +扩展+ JSON

#2


1  

No, you can't, and if you could then you would be insane to do so as it would allow everybody to make arbitrary SQL queries.

不,你不能这样做,如果你能这样做,那你就疯了,因为这会让每个人都可以进行任意的SQL查询。

#3


0  

Html and Javascript are the Front end side languages, it not advisable to use those languages features to connect to database. Later it would be very tough to maintain it and enhance it.

Html和Javascript是前端语言,不建议使用这些语言特性来连接数据库。以后维护和增强它将会非常困难。

ALWAYS THINK IN FUTURE PERSPECTIVE, else your code becomes obsolete

总是从未来的角度考虑,否则你的代码就会过时

instead you can use any scripting language like php to connect to database. Since you wanted to create a website, obviously PHP and mysal will be always available to you at NO COST.

相反,您可以使用任何脚本语言,比如php来连接数据库。因为您想要创建一个网站,显然PHP和mysal将始终免费提供给您。

#4


0  

Use javascript and maybe you may not want to connect to mysql... Try .csv formats and excel... It's good if you are not storing sensitive information.

使用javascript,也许你不想连接到mysql……尝试.csv格式和excel…如果你不存储敏感信息,那就更好了。