javascript and css files are not working correctly when rendering a page via an Ajax request:…
[code]
public function actionCalendar($id)
{
.....
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['/event/index']);
} else {
return $this->renderAjax('update', [
'model' => $model,
'event' => $event,
'create' => 0
]);
}
[code]
I see the js scripts getting loaded but not the css files. I get the following error on firebug:
ReferenceError: datetimepicker_3d3e8a36 is not defined
… assets/aca25140/jquery.js line 328 > eval
Line 1
The jQuery works fine when I go straight to the page, but when I load it via ajax,I get that error. When loading the page via ajax, one of the js scripts works and the other one does not. The one that works does not depend on loading a css file. CSS files do not get loaded at all. I’m not sure if the error defined is due to this id not being defined in a css file, since the css files are not being loaded. I want the page rendered via ajax because I do not want the whole page to load, only the form part, but I need the css and the javascript that goes with it.