It is good idea not to hardcode anything that may change in javascript. For example I want to have url generated by php.
I may write
echo "
<script ...>
var anUrl = $urlFromPHP;
</script>";
and then:
<script ...>
// some code
$.ajax({ url: anUrl ... });
</script>";
Is there any better way to do it? Does anybody know if there is any built-in mechanism in yii framework?