Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.
/lib/ -> jslib.php (source)

This file contains various javascript related functions, all functions here are self contained and can be used in ABORT_AFTER_CONFIG scripts.

Copyright: 2012 Petr Skoda (skodak) {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 133 lines (4 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 1 file
 lib/xsendfilelib.php

Defines 5 functions


Functions that are not part of a class:

js_send_cached($jspath, $etag, $filename = 'javascript.php')   X-Ref
Send javascript file content with as much caching as possible

param: string $jspath
param: string $etag
param: string $filename

js_send_uncached($js, $filename = 'javascript.php')   X-Ref
Send javascript without any caching

param: string $js
param: string $filename

js_send_unmodified($lastmodified, $etag)   X-Ref
Send file not modified headers

param: int $lastmodified
param: string $etag

js_write_cache_file_content($file, $content)   X-Ref
Create cache file for JS content

param: string $file full file path to cache file
param: string $content JS code

js_send_css_not_found()   X-Ref
Sends a 404 message about CSS not being found.