I have a variable I need to drop into a javascript file and can't seem to get any results. I've tried making the .js into a php and adding an echo but it doesn't work.
I have a file that calls this in it
<script type="text/javascript" src="/file.php"></script>
Inside of file.php I have this line
style: {
color: '#<?php echo $_SESSION['colorOne']; ?>'
}
Everything works perfect when I replace the php with an actual color (#FFFFFF). I run into problems when I add the php.
style:
is css , not javascript – Cherniv Sep 9 '13 at 5:49Object
literal. The:
afterstyle
wouldn't really belong if CSS. – Jonathan Lonowski Sep 9 '13 at 5:50