Как подключить JS только на открытие топика?
Подключаю JS ко всему сайту так:
HookPlayer.class.php:
inject_html_head.tpl:
Нужно чтобы JS срабатывал только когда я открываю топик.
HookPlayer.class.php:
public function RegisterHook() {
$this->AddHook('template_html_head_end', 'html_head', __CLASS__);
}
public function html_head() {
return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__).'inject_html_head.tpl');
}
inject_html_head.tpl:
{literal}
<script type="text/javascript">
$(document).ready(function(){
});
</script>
{/literal}
Нужно чтобы JS срабатывал только когда я открываю топик.
4 комментария