User:Dustin3441

function LoadNewMessages { // Loads new messages from retrieve_new.php file into new_posts div $('#new_posts').load("retrieve_new.php"); // Determines whether or not there is a new message by searching new_posts div if (document.getElementById('new_posts').innerHTML != '') { // If nothing exists it won't do anything but if there is it will post this: $('#chatbox').prepend(""+document.getElementById('new_posts').innerHTML+" ");   // This makes it fade in. Not necessary but cool. $('#new_message').fadeIn(1000);   // Empties the div for future posts. $('#actions').html("");  }}// Refreshes and checks for new messages. setInterval("LoadNewMessages;", 1000);