Website page change question

ok, so… what i’m really looking for here is the idea. this is something some of you know how to do easily, and use all the time… but as a novice, i’m trying to learn the proper techniques.

I’m at the stage where I can build functioning classes, and use custom event listeners for activity through out a website… but i’ve been teaching myself so i’m sure I’m missing some important stuff.

how do you change pages in a website??.. I mean I can’t always create a function for each page and just store the active page in a string, can I? Then I end up writing out every possibility. I know it has to do with having some kind of other class to handle the page change I think… but yeah

I’d be so happy if someone just gave me a nudge in the right direction.