Obfuscate javascript generated by PHP -


i have audioplayer running on website. there's no problem player although wish obfuscate javascript code.

the problem javascript called on page includes php file.

the player.php contains:

<script type="text/javascript">   $(function(){     $('.player').plate({         playlist: [             <?php include ('inc/trackimport.inc.php'); ?>         ]     });   });   </script> 

and trackimport generates (in foreach each $dj found in database):

echo '{"title":"'.$dj.'", "artist":"'.$set.'", "cover":"http://domain.com/'.$imglink.'", "file":"http://domain.com/'.$djurl.'/archive/'.$url.'"},'; 

is there away make full code obfuscated?

your best bet use one of these php-based javascript minifiers. it's same effect, can put in configuration flag make 1 of them run when want it.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -