Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript I Don’t Get Asynchronous Updates

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25082
    mattch
    Member

    So this code gets the latest ten dog photos from Flickr using jquery and json. But, how do I get it auto updating when a new photo is available (like twitter search). What are the steps involved?

    Code:

    #59017
    Mr KiTT3N
    Member

    Kinda simple, all you have to do is wrap the ajax call in a function and name it and call a setInterval() call like the following

    Code:

    every 3 seconds

    Second way to do it though more dirty is to wrap the entire code in the setInterval() like so

    Code:

    Either way the function has 2 parameters setInterval(function, time)
    note that the time is set in ms (3000 = 3 seconds, 500 = 1/2 a second, ect)

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.