Jump to content


Ajax Update automatically


2 replies to this topic

#1 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 26 July 2008 - 01:04 PM

Hi guys, I saw an Ajax script a long time ago that if there was something new inserted into the database it would update the page without the user having to refresh. Does anyone know where I could find something like this?

Edited by dEcade, 26 July 2008 - 07:52 PM.


#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 26 July 2008 - 04:15 PM

:)
http://www.pixel2life.com/forums/index.php...;hl=auto+update

#3 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 26 July 2008 - 04:53 PM

Ok I'm working on a chat script and I've got it to work but right now what I've been using is this:

<script type="text/javascript">
setTimeout("window.location.replace('WHAT EVER')", 2000);
</script>

but I don't want it to keep refreshing so I thought that there could be an ajax thing so that when something new is added to database it will automatically update the chat window without refreshing. I would also make it so that it submits without it refreshing.

View Postrc69, on Dec 21 2007, 11:20 PM, said:

:)

To update a div with JavaScript, you typically change the innerHTML attribute.

I know how to do it that way. I just don't know how to make it know something new is added.

Also I really don't need anything fancy I just need something that will do the job quick and efficient.

I hope I clarified myself a little more about what I'm looking for.

Edited by dEcade, 26 July 2008 - 05:14 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users