-
October 9th, 2009, 11:04 AM
#1
Save real-time data in client PC
Hi all
I am a newbie to Ajax and Javasript. Please help me out...
I am using Ajax and Javascript to show real-time data on the web page. On my web page, a 4-digit number is displayed in a text box and this number updates every 10 millisecond automatically to display real-time data (show 100 numbers per second).
What I would like to do is to save the lastest 10 second data in the local PC (client PC) when client clicks a button on the page. Is that possbile with Javascript and Ajax? Or is there any other ways to sort it out?
Any suggestions I would appreciate it .
Many thanks
-
October 12th, 2009, 03:34 AM
#2
Re: Save real-time data in client PC
Probably the "safest" way to cache that data client side is through a cookie. You can read and write these through client-side JavaScript as well as server side code.
-
October 15th, 2009, 04:40 PM
#3
Re: Save real-time data in client PC
you already have the data saved on the client machine in the textbox where it is displayed... all you need to do is make sure it doesnt reload for 10 seconds... like this:
call "ReloadTextVal()" on the page load... you can do this by placing onload="javascript:ReloadTextVal();" as an attribute in the <body> tag. Each time the function finishes running it will set a timeout to be called again in 10 seconds...
function ReloadTextVal()
{
///put your
/// ajax call
/// code here...
//call this function again in 10 seconds
window.setTimeout("ReloadTextVal()",10000);
}
function AjaxResponseCall()
{
document.all.TEXTBOX_FIELD.value="VALUE RETRIEVED BY AJAX";
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|