I have a project that uses Smarty files, but i don't understand how are they parsed from PHP to tpl. I understand that from tpl files to PHP are parsed with js that uses AJAX. And please share some good AJAX guides, i mostly find people using this nonsense to parse PHP data to javascript
<script type="text/javascript">
var a = <?php echo json_encode($var); ?>;
</script>