I basically have two frames on my page, the top one contains users stats and the bottom frame contains the website.
I want to have a message icon on the top frame which would flash once the user gets a new message. Obviously I would have one message icon which doesn't flash and another which does.
Right now i refresh the top frame every 30 seconds so that the stats update. But is there an easier way to refresh? I mean right now the whole top frame refreshes which can get annoying.
I was told to use AJAX to refresh the values, instead of the whole frame.
I currently use this html code to refresh the whole frame:
Expand|Select|Wrap|Line Numbers
- <META http-equiv="refresh" content="10">
The part i want to refresh is:
[PHP]
<?php
if ($inbox > 0){ echo "<a href=inbox.php target=middle><img border=0 src=images/unread1.gif align=left width=16 height=11></a> ";
}else{ echo "<img src=images/read.gif align=left width=16 height=11>"; }
if ($inbox > 0){ echo "<span style=FONT-WEIGHT:bold><a href=inbox.php
ONMOUSEOUT=\"javascript:document.location.reload() ;\"
target=middle><font color=#990066>$inbox New </a></font></span>"; } ?>[/PHP]
Please let me know how to apply an AJAX code to it so that the message status is updated.
Thanks