Hi,
I ran into a problem with jQuery and AJAX requests.
I have a page (with CJuiDiaglog) where jquery.js is already loaded and then I trigger a XMLHTTP-Request.
Within the content to be loaded (with an ajaxButton) ‘jquery.js’ is also automatically inserted, because I render a view with $processOutput = true.
This breaks the buttons of my CJuiDialog, they do not work anymore, FireBug says dialog() is undefined.
Because jquery is initialized a second time some event handlers are lost.
I hot-fixed this by adding these lines to CClientScript, line 352:
public function registerCoreScript($name)
{
if (Yii::app()->request->isAjaxRequest && $name == "jquery")
return;
if(isset($this->_coreScripts[$name]))
return;
If this is an ajaxRequest we should be able to safely skip loading of jquery, which caused the ajaxRequest
Looks like this is related: http://www.yiiframework.com/forum/index.php?/topic/1710-ajaxsubmitbutton-works-only-once/
Yii version: 1.1rc
Any other ideas or should I open a ticket?
Best regards,
schmunk