0

Hi,
i need to buld an application that goes to a PHP (over ajax) and gets currency quotes every 1 seccond.
(I have set the PHP code and its working fine).
if you take a look at the table in the next page:
http://www.forex-markets.com/quotes_exotic.htm (just an example)
i need to refresh the quotes every 1 second.
what is the best way to do that?

after 90 requests the the browder crashed.
i always makes sure to delete the object.
and im always waiting for status 200 to send the new request so i wont create an over head.

any ideas how todo that?
thanks.

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Luckychap
0

Use a loop with a timer delay. I would lengthen the amount between polls as 1 sec is a little ambitious for response time.
while(true)
{
//delay for 1 sec
//update quote
}

0

use setTimeout("function_name();", time(in milisec)); forx example you have a function which fires ajax request every 1 sec. So use it this way:

function funAjax() {
     //Code to send the ajax request

    setTimeout("funAjax();", 1000);
}

After every 1 sec function funAjax will be called.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.