I am trying to pull a string variable into my javascript function from a PHP file and am being returned: Uncaught SyntaxError: Unexpected end of input
.
I have tried to use onclick="showContent('home')"
but this does not load the page at all. I assumed that placing home in parentheses would act as a string parameter and fill that variable in the javascript function.
In my header.php:
echo "<img src='../images/home.png' onclick='showContent('home')' alt='Home' /></a>";
In my menu.js:
function showContent(showThis){
alert(showThis);
}