ayman
ayman

Reputation: 51

ajax techniques

How can I use ajax to periodically (every 10 seconds) retrieve data from an XML document?

Upvotes: 2

Views: 342

Answers (2)

Quentin
Quentin

Reputation: 943143

The same way as usual but with the addition of setInterval

Upvotes: 4

Harry Joy
Harry Joy

Reputation: 59650

Ajax function can operate same as javascript function. You can use setTimeout("func_name()",10000); to call your ajax function every 10 seconds.

example:-

function ajaxFunc(){
   //-- ajax logic
   setTimeout("ajaxFunc()",10000);
}

Upvotes: 1

Related Questions