Skip to content

Commit

Permalink
Dev: remove the scripts loaded via ajax when loading next page
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 4, 2017
1 parent 07c899a commit 75f5011
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 75f5011

Please sign in to comment.