title: Using module params in javascript (javascript in php)
body: <p>I have a simple module, and now I want to use custom module parameters in my javascript file. If I use js extension, I can not use php code, but if I try this:</p>
  
  <pre><code>$doc = JFactory::getDocument();
  $doc-&gt;addScript(JURI::root() . 'modules/mod_homenewslist/js/newslist.php'); 
  </code></pre>
  
  <p>I get following error:</p>
  
  <pre><code>SyntaxError: syntax error
  &lt;script type="text/javascript"&gt;
  </code></pre>
  
  <p>Inside newslist.php I tried following:</p>
  
  <pre><code>&lt;?php echo' &lt;script type="text/javascript"&gt;' ?&gt;
  console.log(300);
  &lt;?php echo "&lt;/script&gt;"; ?&gt;
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  console.log(300);
  &lt;/script&gt;;
  </code></pre>
  
  <p>The result is the same. Is it possible to load php as script, or to use module parameters in js file?</p>