The fundamental reason for why you're seeing this error is that the variable doesn't start with a valid character:
An identifier must start with $, _, or any character in the Unicode categories > “Uppercase letter (Lu)”, “Lowercase letter (Ll)”, “Titlecase letter (Lt)”,
“Modifier letter (Lm)”, “Other letter (Lo)”, or “Letter number (Nl)”.
In your case, the easiest way to fix the problem will be to trim the white space from the beginning of the string. If you only want the whitespace at the beginning of the string to be removed, you can use
.replace(/^\s+/g, "")
but if you're happy for the whitespace at both the beginning and end of the whitespace removed you can use the .trim() function
view_Invoic = view_Invoic.trim()trim()as followvar view_Invoice = '<%= string.trim()%>'