问题
I updated my TYPO3 version from 6.2.31 to 8.7.19. Now there are some problems with JS/JQuery... I heard somewhere that JQuery is automatically included with the new TYPO3 version.
Is that right?
thanks in advance
回答1:
You need to be a bit more specific on this question: Yes, v8 delivers a jquery version. This is however usually thought to be used in backend modules and large parts of the overall backend rely on this.
For frontend, it is often better to ship your own jquery version by for instance your site specifec extension to not introduce this dependency to the core jquery version, which may change over time and may eventually introduce regressions if you upgrade core later.
回答2:
Rendering of some default elements has changed between the versions.
Therefore it might be the case that some jquery-selectors are not working anymore.
Theoretically you've the 2 options to either adjust the javascript or change the rendering to the old kind.
I'd advise to use the first possibility and change the javascript, which is using jquery, perhaps you take the chance to directly update the included jquery-version.
Direct answer to your question: yes it's included but in an individualized version, primary for usage in Backend. In frontend you're free to include your own version or use a version that might be included by an extension.
回答3:
jQuery is shipped with TYPO3, but not used in frontend automatically.
You can use jQuery in frontend, to include it you can add the following TypoScript to your setup.typoscript
(or whereever you create your page-object):
page {
javascriptLibs {
jQuery = 1
jQuery.version = latest
jQuery.source = local
jQuery.noConflict = 0
#jQuery.noConflict.namespace = ownNamespace
}
}
To prevent your scripts from throwing errors, make sure to include jQuery before using it in other scripts.
来源:https://stackoverflow.com/questions/52204177/typo3-v8-7-jquery-included