when ever i am giving a space between a word & i click to call a function, then i am getting the below error:
SyntaxError: unterminated string literal
[Break On This Error]
$(this).SelectProjectBox(363,"ssss
mypage# (line 1, col 29)
Browser generated html:
<span ssasas")="" onclick="$(this).SelectProjectBox(363,"ssss" href="#">ssss ssasas</span>
My actual code
echo '<span href="#" onClick=$(this).SelectProjectBox(' . $cat->project_id . ',"'.$cat->project_name.'")>' . $cat->project_name . '</span>';
what is the cause Please suggestion, how can i modify my php code for this?
echo '<span href="#" onClick="$(this).SelectProjectBox(\''.$cat->project_id .'\',\''.$cat->project_name.'\')">'.$cat->project_name.'</span>';