> and "myfile.js" has:
> ....
> alert("<?php echo JText::_('MY_CONST');?>");
> .....
> But the alert shows:
> <?php echo JText::_('MY_CONST');?>
>
> What I am doing wrong?
*.js is not parsed by the PHP interpreter. Try renaming your file to
"myfile.php". Maybe you'll have to add an extra PHP line to the
beginning of the file to set the Content-Type header.
Regards,
Niels
--
| http://barcamp-wk.de · 1. Barcamp Westküste 30./31. März 2012 |
| http://www.bsds.de · BSDS Braczek Software- und DatenSysteme |
| Webdesign · Webhosting · e-Commerce · Joomla! Content Management |
------------------------------------------------------------------
> What do you mean by "add an extra PHP line to the
> beginning of the file to set the Content-Type header."?
<?php header('Content-Type: text/javascript'); ?>