javascript - If/else if/else error - unexpected identifier -
i'm trying execute if/elseif/else
statement, getting unexpected identifier error on second else if
. rest of statement works fine. i'm new coding, apologize if simple mistake.
if (jquery("#question").val() === "" && (rowcount == 1)) { analysis_empty=1; } else if (rowcount > 1) { jquery('.analysis_empty_title').css({"line-height":"normal"}); jquery('.analysis_empty_title').text("results displayed date groups"); jquery('#here').html(jquery('#dategrouptable').clone().attr('id', 'tableb_copy')); jquery('#tableb_copy').css({"font-style":"italic"}); var ptr = jquery("#tableb_copy").find("tr"); ptr.find("td:last").remove(); } else if ((rowcount > 1) , (jquery("#question").val() != "" )){ jquery('#analquestion_empty').css({"display":"none"});//error here } else { analysis_empty=0; jquery('#analquestion_empty').css({"display":"none"}); }
any thoughts?
the problem and
keyword you're using, since doesn't exist in javascript.
you should replace &&
, e.g:
else if ((rowcount > 1) && (jquery("#question").val() != "" )){
Comments
Post a Comment