How to interact with database data with Javascript

Asked

Viewed 135 times

0

I was looking to build a chart with HTML Canvas using Javascript as well. The required data is in the Mysql database. However, how can I interact and access this data from the Javascript database, since it is not safe to use this language for connection to the database? It would be a JSON page an appropriate solution?

1 answer

0

The best way is to send an ajax request to your API, your API does the query in the database and returns a reply JSON. From the moment you are in possession of your JSON, just do what you want with the data.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.