Calling javascript functions in Yii


I did my best to search for answers but I can’t find any example that really helps.

I’m going to use : for steaming callbacks of file_get_contents()

I have serval URLs to get, so, I will have a loop though them meanwhile wish to use a progress bar to display its progress.

The example of application.extensions.jui.EProgressBar doesn’t provide a call back using php, instead it’s just javascript. I’m not sure what I should do to call the callback of the progressbar:

echo '<script LANGUAGE="javascript"><!--

                        myProgressBar.progressbar("option", "value", 10);

                        "// --></SCRIPT>';

this doesn’t seem to work. Someone please lead me to the correct way to do things with javascripts and Yii. I’m new. Thank you!

Did you find a solution to this?


I have never used that, instead what I did in one my past projects was the IFRAME trick. When a user made a search, the call was redirected to a the results page that ‘streamed’ contents in an IFRAME were updating layers on the results page by calling Javascript functions periodically.

The IFRAME was filled with contents of type:

// whatever is flushed within the script tags will be automatically executed when

// rendered on the docs


      // parent.myProgressBar.progressbar("option", "value", 10); -- example

       parent.theUpdateJavascriptFunction('values'); // 


Every time there was something to be flushed from the server script and to update on the results page. The parent had the ‘theUpdateJavascriptFunction()’ which was the one responsable to update the layers of its document.