$(obj).replaceWith('<a class="fd-tool-li" onclick="javascript:Like(this, @Model.User.HOCODE.ToString(), @Model.CommentHOCODE.ToString());">' +
'<i class="icon-thumbs-up"></i><span> ' +UserCount+ ' Like this</span>'+
'<a name="Unlike"class="fd-tool-li" onclick="javascript:Unlike(this, @Model.User.HOCODE.ToString(), @Model.CommentHOCODE.ToString());">(Unlike?)</a>' +
'</a>');
Why am I getting this error ?
Simplify your code to avoid quote problems (and improve readibility). Extract the onclick javascript from you replace call :
That’s supposing the @Model is defined by a precompiler of some sort and isn’t present in the code.