I am not a JavaScript developer and I'm facing an issue (Uncaught SyntaxError: Unexpected token else)
on one of our web pages ...
I strongly believe this is a repetition of 2 previously answered questions in similar topics:
1) Syntax Error: Unexpected token Else 2) Prompt JavaScript If Else Unexpected Token else
So, I admit my mistake ... However, I need to confirm if my case completely matches the referenced cases by checking for a trailing ;
Here's the script causing the issue:
<script type="text/javascript">
if("0" == 0) var t = 'existing' else var t = 'new';
document.write('<scr'+'ipt type="text/javascript" src="//my.domain.com/tag.js?ck=XXX&Retarget=domain:'+t+':psd:sku:XXXXXXXX"></scr'+'ipt>');
</script>
In Chrome, the error occurs after the if statement