title: How to pass php variable's value to jquery
body: <p>I have a php variable:</p>
  
  <pre><code>$name_of_current_page
  </code></pre>
  
  <p>which I have available in my view, and I want to make the value available to jquery. Is the best way to do it like the following?</p>
  
  <pre><code>$(document).ready(function () {
              var current page = "&lt;?php echo $name_of_current_page; ?&gt;" ;
  
  });
  </code></pre>