public function js($url, $inhead = false) {
        $url = $this->js_fix_url($url);
        $where = $inhead ? 'head' : 'footer';
        $this->jsincludes[$where][$url->out()] = $url;
    }
public function js($url, $inhead = false) {
        $url = $this->js_fix_url($url);
        $where = $inhead ? 'head' : 'footer';
        $this->jsincludes[$where][$url->out()] = $url;
    }
public function js ( $ url , $ inhead = false ) { $ url = $ this -> js_fix_url ( $ url ) ; $ where = $ inhead ? 'head' : 'footer' ; $ this -> jsincludes [ $ where ] [ $ url -> out ( ) ] = $ url ; }
Ensure that the specified JavaScript file is linked to from this page.

NOTE: This function is to be used in RARE CASES ONLY, please store your JS in module.js file
and use $PAGE->requires->js_init_call() instead or use /yui/ subdirectories for YUI modules.

By default the link is put at the end of the page, since this gives best page-load performance.

Even if a particular script is requested more than once, it will only be linked
to once.

@param string|moodle_url $url The path to the .js file, relative to $CFG->dirroot / $CFG->wwwroot.
For example '/mod/mymod/customscripts.js'; use moodle_url for external scripts
@param bool $inhead initialise in head
Ensure that the specified JavaScript file is linked to from this page .