diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php
index <HASH>..<HASH> 100644
--- a/lib/ajax/ajaxlib.php
+++ b/lib/ajax/ajaxlib.php
@@ -1285,7 +1285,7 @@ class jsportal {
      * Prints the JavaScript code needed to set up AJAX for the course.
      */
     function print_javascript($courseid, $return=false) {
-        global $CFG, $USER;
+        global $CFG, $USER, $OUTPUT;
 
         $blocksoutput = $output = '';
         for ($i=0; $i<count($this->blocks); $i++) {
ajaxlib MDL-<I> Fixed minor bug because of missing global