diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index 447bb8262ab..a9b1685a8a1 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -1171,8 +1171,8 @@ public function setJavascriptVar($iSurveyId='') $aLSJavascriptVar['startPopups'] = new stdClass; $sLSJavascriptVar = "LSvar=".json_encode($aLSJavascriptVar) . ';'; $sLSJavascriptVar = "LSvar=".json_encode($aLSJavascriptVar) . ';'; - App()->clientScript->registerScript('sLSJavascriptVar',$sLSJavascriptVar,CClientScript::POS_HEAD); - App()->clientScript->registerScript('setJsVar',"setJsVar();",CClientScript::POS_BEGIN); // Ensure all js var is set before rendering the page (User can click before $.ready) + App()->clientScript->registerScript('sLSJavascriptVar',$sLSJavascriptVar,CClientScript::POS_HEAD, array("class"=>"toRemoveOnAjax")); + App()->clientScript->registerScript('setJsVar',"setJsVar();",CClientScript::POS_BEGIN, array("class"=>"toRemoveOnAjax")); // Ensure all js var is set before rendering the page (User can click before $.ready) } }