i’m curious about the purpose of registering a javascript via YII’s “registerScript()” instead of writing it directly on the view. i compared both and it does the same thing except the former adds a CDATA around the script.
the class reference doesn’t explain much, so i’m wondering if anyone here can enlighten me?
What is the best way to format my JS code in the registerScript function? For example, because the code has to be written within a string, this means that I lose stuff like syntax highlighting in my text editor.