title: Yii renderpartial (proccessoutput = true) Avoid Duplicate js request
body: <p>Im creating a site who works with ajaxRequest, when I click a link, it will load using ajaxRequest. When I load for example user/login <b>UserController actionLogin</b>, I <b>renderPartial the view with processOUtput to true</b> so the js needed inside that view will be generated, however if I have clientScriptRegister inside that view with events, how can I avoid to generate the scriptRegistered twice or multiple depending on the ajaxRequest? I have tried <code>Yii::app()->clientScript->isSCriptRegistered('scriptId')</code> to check if the script is already registered but it seems that if you used ajaxRequest, the <strong>result is always false</strong> because it will only be true after the render is finished. </p>
  
  <p>Controller code</p>
  
  <pre><code>if (Yii::app()-&gt;request-&gt;isAjaxRequest)
  {
     $this-&gt;renderPartial('view',array('model'=&gt;$model),false,true);
  }
  </code></pre>
  
  <p>View Code</p>
  
  <pre><code>if (!Yii::app()-&gt;clientScript-&gt;isScriptregistered("view-script"))
     Yii::app()-&gt;clientScript-&gt;registerScript("view-script","
        $('.link').live('click',function(){
           alert('test');
       })
  ");
  </code></pre>
  
  <p>If I request for the controller for the first time, it works perfectly (alert 1 time) but if I request again for that same controller without refreshing my page and just using ajaxRequest, the alert will output twice if you click it (because it keeps on generating eventhough you already registered it once) </p>
  
  <p>This is the same if you have <strong>CActiveForm</strong> inside the view with jquery functionality.. the corescript yiiactiveform will be called everytime you renderPartial.</p>