I have a div and some labels in it. The labels show information by a given php object’s properties.
I want to update that object by an ajax request in every 3 seconds and then update the div by the newest object’s properties.
How can I do that ? Actually I am curious about calling the function and reading return object’s properties in the jquery ajax function. I can handle other parts.
Thanks in advance,
You can use
setIntervalsomething like this:where the function
yourAjaxFundoes updating you need.You can clear the interval any time later using:
From your php code, you can use
json_encodefunction on your object to return it as JSON so that you can parse the returned response using jQuery JSON parsing function egparseJSON