Ajaxing Widgets With Js Inside

Hi (this is my first post here hello),

I’m building site where nearly part of it is AJAXed, including static content, scripts and stylesheets. I’ve encountered problem during requesting from server HTML in which there is widget that uses JS and also a CActiveForm(with ajax validation enabled). Scripts generally aren’t loaded at all.

My question is, is there any way to enlist JS and CSS of a widget as an array in PHP(so I could first download scripts, and then apply HTML to DOM).