I have this bit of code:
var curState = 'Agenda';
function switchState(newState) {
curState = newState;
}
function Inbox() {
switchState('Inbox');
document.getElementById("u-content").innerHTML = "Currently, you're viewing the Inbox.";
}
function Friends() {
switchState('Friends');
document.getElementById("u-content").innerHTML = "Currently, you're viewing the Friends.";
}
function Agenda() {
switchState('Agenda');
document.getElementById("u-content").innerHTML = "Currently, you're viewing the Agenda.";
}
function List() {
switchState('List');
document.getElementById("u-content").innerHTML = "Currently, you're viewing the Book List.";
}
function News() {
switchState('News');
document.getElementById("u-content").innerHTML = "Currently, you're viewing the News.";
}
function Notes() {
switchState('Notes');
document.getElementById("u-content").innerHTML = "Currently, you're viewing the Notes.";
}
Of course the text displayed is a test and I will change it. The point is, I'd have to put a lot of text into these 'statuses' of a menu and to simply type it out in here is not very handy, especially if there are changes to be made later on. Therefore I'd like to know how to add different forms of files in JavaScript, or let them display using JavaScript, like a *.php file.
Is there somebody who knows how to do such a thing? I've searched quite a lot on the internet, but was unable to find something useful to me, except document.getElementById().innerHTML = "";