Sfigura Posted June 19, 2016 Share Posted June 19, 2016 Всем привет! Проблема в следующем, имеется модуль доставки, который загружает в Хидер скрипт со ссылкой на сервер службы доставки, иногда их сервер виснит и мой сайт перестает работать тоже. Вопрос, как сделать, чтобы скрипт загружался асинхронно? Код выглядит так: public function hookdisplayHeader($params) { $this->context->controller->addJS((Configuration::get('PS_SSL_ENABLED')?'https':'http').'path/to/file'); } Заранее благодарен. Link to comment Share on other sites More sharing options...
wagood Posted June 19, 2016 Share Posted June 19, 2016 Можно попробовать удалить этот вызов из модуля и вставить его напрямую в header.tpl или в footer.tpl <script type="text/javascript" async src="//path/to/file"></script> Link to comment Share on other sites More sharing options...
Sfigura Posted June 21, 2016 Author Share Posted June 21, 2016 Спасибо за идею. Сделал, как вы советуете, сайт больше не виснет. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now