title: Generate random number every x seconds and display it
body: <p>Inside my App I have a sort of bottom bar Always shown, where I have a div with an h1, and a button. Everytime I click the button I coded and animation that do change the text of the h1 with a random number. Till here everything works fine. </p>
  
  <p>My goal is to make this thing WITHOUT pressing a button, but just every x seconds during all the App execution. I tried to use "setInterval(func, ms);" I didn't get any error, but it just did it one time.</p>
  
  <p>I think that my error is "where to put" the code. I don't understand this. So, I tried to put the code on the event handler of my button just to see if it works, but it did it one time anyway. I need that this function continues to be executed while the users do something else... It's like a clock inside an app: it should work continuosly while you do something else.</p>
  
  <p>My function code:</p>
  
  <pre><code>function fraseCasuale(sel) {
      var i = 1 + Math.floor(Math.random() * (groupedItems.length-1));
      var oggetto = groupedItems.getAt(i);
  
      if (sel === 1) {
          document.getElementById("frasecasuale").textContent = oggetto.frase;
          document.getElementById("autore").textContent = oggetto.nome;
          document.getElementById("genere").textContent = oggetto.genere;
      } else {
          document.getElementById("frasecasuale2").textContent = oggetto.frase;
          document.getElementById("autore2").textContent = oggetto.nome;
          document.getElementById("genere2").textContent = oggetto.genere;
      }
  }
  </code></pre>
  
  <p>And then how I call it, for example:</p>
  
  <pre><code>setInterval(fraseCasuale(1), 5000);
  </code></pre>
  
  <p>My application is based on the grid template of Visual Studio 2012 for Windows Store aps. I added the bar I was talking above into "default.html", which is the container of the other pages.</p>