I am getting an error - John is not recognized

I am getting an error - John is not recognized

Hi Experts,
 
I have tried to resolve this but still running into errors.
 
I am just trying to pass two url parameters to another page with this code:
 
  1.        return "<a target='tab' data-tab-name='#RequestDetails' data-tab-index='2' href='viewDetails.php?loginName="
            + <?php echo $user; ?> + "&ID=" + oObj.aData["ID"] + "'> " + oObj.aData["ID"] + " </a>";
But when I run this code, instead of passing john.doe, it gives an error that john is undefined.
 
Any ideas how to resolve this?
Thanks alot in advance