Adding scripts to OctoberCMS

Viewing the blog post

Posted in Octobercms on Apr 01, 2018

Just a quick note on adding javascript to your OctoberCMS site.

You can do it inside the backend view as follows :-

{% put scripts %}
    <script src='https://www.google.com/recaptcha/api.js'></script>
{% endput %}

If you have some code to run in a custom plugin :-

public function onRun() {
    $this->addJs('https://www.google.com/recaptcha/api.js');
}