...

Jquery - polling

able
03-04-2008, 02:33 PM
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

Isaak
03-04-2008, 09:18 PM
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.

able
03-05-2008, 01:45 PM
Thanks for that, heres hoping.

sybil6
04-08-2008, 12:57 PM
create a custom function which does exactly what you want
sure he does :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum