Access database and use the data in Javascript

It is typical for web pages to process postbacks and update the page from that. For example How to handel postback event in php - PHP - The SitePoint Forums. That is probably the oldest way to do it but if it can satisfy requirements then it could be easier.