I have a website which has a mysql db which records how many visitors i have.
I want a message box to pop up everytime a visitor logs on.
if it does it plays a "ping" sound. this works fine, but I think as the php file is seperate from my index.php
the message never appears.
many thanks.... twisting my melon.... kev
You can store the responseText in a global variable. When the next ajax request is sent to check if any more visitors have logged in, compare its responsetext value with the global variable value and if the visitor count has increased display an appropriate message. This can all be done in your onreadystatechange handler.