Update functions.php

Add a hook to get the page title in JavaScript files.