I think you need an Ajax
request.
Ajax
stands for Asynchronous Javascript and XML, but it can convert the response of the page to a JSON as well.
There are some libraries in Javascript that ease the use of this technique, like jQuery.
You could pull the data from an php page asynchronously (i.e., without blocking the page) and display it for the user. You can find many exemples like these among the internet.
The jQuery documentation on Ajax is here: http://api.jquery.com/category/ajax/