How to output PHP inside JS/jQuery that generates HTML?

QuestionsHow to output PHP inside JS/jQuery that generates HTML?
sethbeckerman5 Staff asked 4 years ago

I have to run a PHP action that is inside HTML which is inside a JS script. The current code does an error because the function that renders HTML breaks the syntax. I am getting Uncaught SyntaxError: Unexpected token '='
Here is my code example:

Here is the output with failed structure in line 8 (Uncaught SyntaxError: Unexpected token '='):

Is there anything possible to avoid the syntax error?


View on Stack Overflow