$doc = JFactory::getDocument();
$doc->addScriptDeclaration();
$doc->addStyleDeclaration();
ie. used in plugins.
No warnings after page validation when using HTML5.
Validation warnings with messages like:
The type attribute is unnecessary for JavaScript resources.
The type attribute is unnecessary for Style resources.
ATM functions addScriptDeclaration() and addStyleDeclaration() doesnt use $doc->isHtml5(); value to generate correct html code.
Tested on Joomla! 3.9.22
Labels |
Added:
?
|
This should be closed as the question as asked and answred
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-04-25 13:11:13 |
Closed_By | ⇒ | Fedik |
answered
The
type
attribute isn't required for HTML5. If it's not present, the browser will treat it as a classic JS script.You can be course set it to
type=module
or something else, depending on the type of script you're writing.Same goes for
type=text/css
on<style>
elements. It's simply not required.I'd refrain from using
validator.w3.org
as it's seriously outdated.