is this a case for switch case? (or am I using the most efficient method)
I want to change the htmltext of a div depending on the body.class
$('body #header').html('you are still here'); //DEFAULT if no body class
$('body.welcomepage #header').html('hello'); //IF bodyclass is welcomepage
$('body.goodbyepage #header').html('goodbye'); //IF bodyclass is goodbypage
What is the best option for performing this?
Should I use an if, elseif, else?
Or should I use a switch case?
My concern is that the above may cause issues because its looking for body.class(es) that potentially don't exist.
SETUP:
On two pages I want to perform a unique action for that page
On the rest of the pages in my site, I want to have a "default" action.
Is it possible to set this up as a swtich case? Would I benefit from that?
Should I create an if then?
Or is this the most efficient method?