Hi Tim,
I've always included my variables that get used in scripts on the page itself:
<!-- set the variable here -->
<script> var foo = <?php echo intval($variablesRecord['variable1']) ?>;</script>
<!-- variable is called in this script -->
<script src="<?php echo PREFIX_URL ?>/assets/js/example.js"></script>
But if you wanted to edit the javascript file directly, you could do so by renaming example.js to example php:
<script src="<?php echo PREFIX_URL ?>/assets/js/example.php"></script>
Then you can ensure that the browser knows the example.php file contains JS by adding the following header, then you can include whatever JS you want after that point:
<?php header("Content-Type: application/javascript"); ?>
var foo = <?php echo intval($variablesRecord['variable1']) ?>;
alert(foo);
Let me know if you have any questions.
Cheers,
Greg
Greg Thomas
PHP Programmer - interactivetools.com