How do I echo php inside javascript correctly?
var timeDiff = 60-20;
if ( timeDiff <= 60 ) {
var stamp = timeDiff <?php echo $this->__('second ago') . '.'; ?>;
}
Console error:
Uncaught SyntaxError: Unexpected identifier
It does echo out 'second ago' in chromes Sources, followed by the error though.
''(like a string literal) - not sure abt PHP syntax