Ajax and concatenate strings not working

I have ajax onclick event on grid application. I try to concatenate string like “,’”.$var."’" and the result is like this ’
var

the event add line feed and carrier return every time when i use a dot to concatenate, someone know how fix this issue?