Zum Inhalt springen

Remove Javascript from extensions and integrate it manually

Please note:

This code example refers to old TYPO3 4.x versions and can no longer be used in current TYPO3 versions.

Various Javascript libraries are loaded as standard in TYPO3. Additional libraries are added for some extensions. It can also happen that Javascript libraries are loaded twice. Two different extensions load the same library several times. This results in conflicts and requires manual adjustment. Unnecessary or multiple loaded Javascripts can be removed manually and only those that are considered useful can be integrated.

To remove all Javascripts from TYPO3 and all extensions, this Typoscript must be included in the root template of the page (note that all JS are removed, not just the libraries):

# deletes all Javascripts included in the "head"
page.includeJS >
# deletes all Javascript libraries included in the "head"
page.includeJSlibs >
# deletes all Javascripts included before the closing "body"
page.includeJSFooter >
# deletes all Javascript libraries included before the closing "body"
page.includeJSFooterlibs >
# deletes all Javascript libraries included inline
page.jsInline >
# deletes all javascripts included inline before the closing "body"
page.jsFooterInline >

With the values "page.jsInline" and "page.jsFooterInline" it must be noted that in most cases the functions (field validation, visual effects, etc.) and not the libraries are defined here!

Include Javascript libraries manually (which are supplied with the TYPO3 core):

page.javascriptLibs {
# prototype
Prototype = 1
# Scriptaculous
Scriptaculous = 1
# Add Scriptaculous modules
Scriptaculous.modules = dragdrop,controls
# ExtCore
ExtCore = 1
# the ExtCore debug file (uncompressed)
ExtCore.debug = 1
# ExtJS
ExtJs = 1
# ext-all.css
ExtJs.css = 1
# standard theme
ExtJs.theme = 1
# load specified adapter (jquery|prototype|yui)
ExtJs.adapter = ...
# QuickTips
ExtJs.quickTips = 1
# the ExtJS debug file (uncompressed)
ExtJs.debug = 1
}

You can then integrate your own JavaScript, e.g:

page.includeJSFooter.file1 = fileadmin/myjs.js 

or that of an extension:

page.includeJS.file2 = typo3conf/ext/EXTENSIONKEY/resources/js/extension.js

or without file:

page.jsInline.10 = TEXT
page.jsInline.10.dataWrap = var pid = {TSFE:id}; alert('pid: '+pid);

This page contains automatically translated content.

Updated: 09.04.2025