使用ajax来调用url

I have a php script on my site (users_online.php) that shows how many people are connected to my server whenever the script is executed and I would like to display and update this information on my front page using javascript / ajax without refreshing the page is this possible ?

Thanks, Kelly

Yes, its certainly possible. You can use jquery or any of the other myriad of js libraries out there.

The process is

  1. fire an xml http request (XHR) with whichever library you choose.
  2. process the response (handle both success and failure)
  3. update your page by dynamically modifying the DOM with your results.