Move AJAX script to base template