Even when I do something as simple as this in my .js file:
var list = "<?php echo 'foo'?>";
the JS variable comes out as:
"<?php echo 'foo'?>"
When I try removing the quotes, I get parsing errors.
I’ve seen several examples like the above on various sites, though, so I seems like this should work.