title: Converting multipage application to single page
body: <p>I am building a TV application for Hbbtv, which works on the TV browser. </p>
  
  <p>However now in my application, each page is specified in using anchor tag and every page loads when I click on a navigation menu.</p>
  
  <p>How do I make this as a single page application as making the main page stay and only load the contents when I choose the menu options.
  I program works on key press</p>
  
  <p>so this is how my javascript looks like</p>
  
  <pre><code>function keyFunction(e) {
  switch(e) {
      case "OK":
          switch(menuPosition) {
              case 1:
                  document.getElementById("msg").innerHTML = "&lt;h2&gt;Welcome to HbbTV Tutorials&lt;/h2&gt;";
                  break;
              case 2:
                  document.getElementById("msg").innerHTML = "&lt;h2&gt; Internet &lt;/h2&gt;";
                  break;
  </code></pre>
  
  <p>Each page has a lot of image and contents, so I don't think I can make use of inner HTML</p>