Javascript and AJAX with Yii

Comparing #4 with #5

Revision #5 was created by bennouna bennouna on Oct 11, 2012, 5:20:44 PM.

Really minor correction: missing opening quotes in two "$cs->registerScript(…)" calls

Content

[...]
Aside [CJavascript::encode()], the method [CJavascript::quote()] can also be useful.
~
```php
$url = $this->createUrl('app/ajaxProcessor');
$cs->registerScript(
'var1', "var myUrl = '" . $url . "';"); // can break with some URLs $cs->registerScript('var1', "var myUrl = '" . CJavascript::quote($url, true) . "';");
```~


### 3. Final words
[...]