I have small code that generated javascript error when I want to display in console $my_var:
I want to display $my_var in the console (I will use it later for append it to a div with jQuery) but I get : Uncaught SyntaxError: missing ) after argument list
PHP:
$my_var = '<script id=\'et4pages\'></script>';
echo '<a href="javascript:display_content(\''. $my_var .'\');">click here</a>';
Javascript :
function display_content(link) {
console.log(link);
}