Refactoring jQuery with PHP constants
<p>This is a clarification and advice question. From building an application I have come to refactor much of my jQuery from the <code>&lt;head&gt;</code> tags into its own .js files. My contention is that I'm using constants to define paths.</p>

<p>Therefore if I refactor code that needs those PHP constants then the jQuery code will not work, because as far as I know I cannot include the init.php file that contains the constants. Am I mistaken? is there a way to include the needed Constants within my jQuery files for code such as the type below:</p>

<pre><code>$.ajax({
    type: "POST",
    url: "&lt;?php echo SITE_PATH; ?&gt;file.php"
});
</code></pre>

<p>The above code is a snippet from a jQuery AJAX POST, which works fine within my head. But if I was to refactor the code to its own JS file how would I go about getting access to the desired constants and using them within JS? </p>

<p>Any thoughts would be appreciated.</p>
