Answer the question
In order to leave comments, you need to log in
Why does jquery work differently in .js file and renderPartial file in Yii?
Good afternoon,
There is a _form.php file that is loaded from create.php via: renderPartial('_form,['model'=>$model]);
In _form.php there are two elements with IDs:
#add-room and #fireball
There is some inconvenience,
From _form.php I can manipulate these elements:
alert($('#add-room').length + ' : ' + $('#fireball').length);
Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/js/scripts.js');
if (Yii::app()->request->isAjaxRequest)
{
Yii::app()->getClientScript()->scriptMap =
[
'jquery.js' => false,
'jquery.min.js' => false,
'jquery-ui.min.js' => false,
'jquery.ba-bbq.js'=>false,
'jquery.yiigridview.js'=>false,
];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question