php constants in a javascript file
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/168214/pass-a-php-string-to-a-javascript-variable-and-escape-newlines">Pass a PHP string to a Javascript variable (and escape newlines)</a>  </p>
</blockquote>



<p>I'm working on a project and it's already done, but it needs one more midification and its applying language constants in javascript files.  </p>

<p>consider we include a javascript file  and in that we have something like this </p>

<pre><code>            alert("YOU Have VOTED BEFORE");
</code></pre>

<p>easy like that , the script will alert that text </p>

<p>but what if we need to alert a language constant of it :</p>

<pre><code>            alert("&lt;?php echo _VOTED_BEFORE?&gt;");
</code></pre>

<p>this will be worked only if echo the script like inline of my php codes ...</p>

<p>but, how can we read and include php constants or $vars for a outside JavaScript file ???</p>
