How can you call the name of a component or page in JavaScript?
Basically, I have named my pages by category, appending a simple letter to the beginning to indicate what type of page it is. For example, if the page is associated with the "About" section, I append an "a". to the beginning. So, a page that states our mission would normally be called "mission". Instead, because you get to it from the "About" page, it is called "aMission".
I want to make some style modifications dependent on the type of page it is. There are various reasons why simply changing the theme won't work, and I don't want to go into details. So, for example, lets say that I want to change the header color based on the type of page. I want to run JavaScript to change the color based on the type of page, using ifelse statements. Essentially, I want to say "If the page name starts with a, then run this script. If it starts with b, then run this. Else, run this". I know how to write the program, but I need to be able to put the page name into a string variable so that I can use it in the ifelse statement. Is there any way that I can, in JavaScript, call the name of the page and put it into a string variable?