Wednesday , March 12 2025

Removing type=’text/javascript’ and type=’text/css’ from Joomla for validator

At first, as a person from the 17th century, I tried stupidly to remove these types in the template code, but this process did not give a result and the validator continued to show warnings. The solution is simpler than it seems at first:

In the folder with the template, find JFactory::getDocument(); and below you need to call the setHtml5 method with the true parameter:

$doc = JFactory::getDocument();
$doc->setHtml5(true);

About iryna

I'm Iryna, a web developer from Ukraine with a decade of experience solving complex technical challenges in the world of freelance. Throughout my career, I've worked on everything from troubleshooting server-side issues and optimizing website performance to enhancing user interfaces. On this blog, I share detailed solutions to the technical problems I’ve encountered and methods that have worked best for me. In addition to my technical expertise, I’m also passionate about digital drawing. I hope the tutorials and insights I provide here will help both fellow developers and creatives alike in their own projects.

Check Also

How to display page title anywhere in Joomla template

This solution was tested on joomla 3, here is the code to use: <h1 itemprop="name"> …

Leave a Reply

Your email address will not be published. Required fields are marked *