Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Jquery - polling

    Hi Folks,

    I'm completely new to js and jquery. I looked at mootools, prototype, scriptalicious etc - but I prefer jquery cause it feels a bit like xpath to me and something semi familiar.

    What I want to do is quite simple (I hope). I have a php script that spits out a count of the number of messages for a user (determined by session cookie) that are waiting to be read.

    I would like to poll this script every X seconds, and update a div with the contents. If the number increases, I'd also like to run some effect on the div to alert the user.

    However, first steps first - how do I poll in jquery?

    Many thanks,
    Able

  • #2
    New to the CF scene
    Join Date
    Feb 2008
    Location
    In your computer
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You'll have to make use of the JavaScript setTimeout() function, create a custom function which does exactly what you want and use setTimeout() to poll it every x seconds.

  • #3
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks for that, heres hoping.

  • #4
    Regular Coder
    Join Date
    Jul 2006
    Posts
    399
    Thanks
    33
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by Isaak View Post
    create a custom function which does exactly what you want
    sure he does


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •