Hello, how do I do a check and check if a given element exists using switch? To be more specific, I'm trying to use this code:
var forumversion = function()
{
invision = jQuery('#ipbwrapper').length ? "invision" : "error";
phpbb2 = jQuery('.bodyline').length ? "phpbb2" : "error";
phpbb3 = jQuery('#wrap').length ? "phpbb3" : "error";
punbb = jQuery('#pun-intro').length ? "punbb" : "error";
}
switch( forumversion )
{
case invision: "Invision";
break;
case phpbb2: "phpBB2";
break;
case phpbb3: "phpBB3";
break;
case punbb: "punbb";
break;
default: "Erro ao identificar a versão do fórum"
}
In this case I want to check the version of certain forums .. To do this I'll check if certain specific elements of each version exist (inside the forumversion var are the elements ..) ..
I'm new with switch yet, where could I be wrong?