2

I am building a TV application for Hbbtv, which works on the TV browser.

However now in my application, each page is specified in using anchor tag and every page loads when I click on a navigation menu.

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

so this is how my javascript looks like

function keyFunction(e) {
switch(e) {
    case "OK":
        switch(menuPosition) {
            case 1:
                document.getElementById("msg").innerHTML = "<h2>Welcome to HbbTV Tutorials</h2>";
                break;
            case 2:
                document.getElementById("msg").innerHTML = "<h2> Internet </h2>";
                break;

Each page has a lot of image and contents, so I don't think I can make use of inner HTML

user-6589801
  • 129
  • 1
  • 15

1 Answers1

1

You could look at JQuery and AJAX. Storing your HTML pages and get the content through AJAX requests fired by user clicks.

This might help you : https://ilovecoding.org/courses/jquery/lessons/ajax-create-a-single-page-app-with-jquery