CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Question 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

  2. #2
    Join Date
    Jun 2009
    Posts
    113

    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.

  3. #3
    Join Date
    Sep 2009
    Posts
    10

    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
  •  





Click Here to Expand Forum to Full Width

Featured