Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

How Can I Make An Auto-updating Shoutbox Type Script?


11 replies to this topic

#11 index.html

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 51 posts

Posted 14 January 2010 - 03:05 PM

two options

you can change it to setInterval('updateShoutbox()', 4000) and it will run ever 4 seconds

or
you can just include another setTimeout('updateShoutbox()', 4000) in the updateShoutbox() function itself-- Just before the closing bracket-- so it will call itself every 4 seconds



function updateShoutbox(){
//send the post to shoutbox.php
$.ajax({
type: "POST", url: "shoutbox.php", data: "action=update",
complete: function(data){
loading.remove();
messageList.html(data.responseText);
}
});
setTimeout('updateShoutbox()', 4000);
}

#12 Rigaudon

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 101 posts
  • Gender:Male
  • Location:<?php echo __FILE__; ?> in other words, right behind you.
  • myCENT:50.57

Posted 09 April 2010 - 03:13 AM

Not sure if anyone is still interested, but I've posted a shoutbox tutorial here:
http://www.knowledgesutra.com/forums/Put-A...sql-t71577.html




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users