Ajax, why ClientScript is needed?

I am reading this Wiki article here:

http://www.yiiframew…87/ajax-update/

but confused by the following word:

what is the situation this paragraph describing here? I have no clue what they talking about, but I think it is pretty important issue in using Ajax.

Thanks!

This should read "send even the client script needed by the partial". Those scripts may already have been included in the main part of the page.

/Tommy

client script means Javascript, right? Can you give an example of "client script needed by the partial"?

Thanks!

Unfortunately, enabling the call to processOutput() by passing true as the fourth parameter to renderPartial(), not only will output the scripts registered in the current request, but also the core scripts, unless prevented for by flagging the package in question with value false in scriptMap. BTW the only difference between render() and renderPartial() in this respect, is that the former will call processOutput() unconditionally.

There’s a already a lot of threads in this forum regarding clientScript, processOutput, scriptMap and various effects of including scripts in ajax loaded content, especially if repeated. You may also want to examine the source code in question, easy accessible through links in the online API reference.

/Tommy

Thanks!

I just couldn’t understand the problem that is associated with 4th parameter, let along the solution. All their discussion doesn’t make sense to me. Let me do some other research first.