skip to Main Content

I have 2 HTML pages: one that ask the user for input about a topic, and one that pulls Twitter data from the Twitter Streaming API pertaining to that topic. This information, however, changes constantly. When I refresh manually, there’s a Pop-up that notifies me that I want to “Confirm Data Resubmission” and when I click “continue”, it gives me new information. I want to do this automatically within my code, and do this every 10 seconds.

My HTML page was created in tandem with Flask, and uses the Twitter Bootstrap CSS and JS files. I tried using the <meta> way and while it does refresh the page automatically, it does not retain the form data submitted on the previous page.

Is such a thing just not possible?

3

Answers


  1. I assume you have a button which submits this form. Have you thought about subscribing to an onClick event? You can create a callback function and inside it invoke location.reload(); from window global object.

    Login or Signup to reply.
  2. You can use:

    location.reload();
    

    and

    setInterval();
    
    Login or Signup to reply.
  3. To set time interval you may use this window.setInterval(function, milliseconds) For documentation

    http://www.w3schools.com/js/js_timing.asp

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search