简体   繁体   中英

How to connect postgres data base using javascript

I'm very new to postgres. I'm trying to connect postgres using javascript but it's not working. How to connect using javascript?

As I understand it, you're trying to do this from within a web browser, which means it just simply ain't gonna work, not no way, not nohow. Most if not all web browsers do not allow code within a page to access any resource (such as your database) which lies outside the browser; this is simply a security measure to prevent hostile web pages from gaining access to your computer.

If you want to create a web page that accesses a database, you must do so using a server-side execution environment such as php or node.js, which can access the database, generate an html page, and then present it to your browser for viewing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM