jQuery and Bootstrap update

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
JurajB
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Fri Oct 02, 2015 3:28 pm

jQuery and Bootstrap update

Post by JurajB » Sat Feb 15, 2020 10:14 am

how do I correctly update jQuery stuff and bootstrap? I will be reformating protostar template on my site.
Thanks.

 
JurajB
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Fri Oct 02, 2015 3:28 pm

Re: jQuery and Bootstrap update

Post by JurajB » Sat Feb 15, 2020 12:26 pm

Please help.
Bootstrap is loading from template index.php fine.
But jQuery doesnt. What code do I need to change. I tried to copy paste new jQuery into joomla files but didnt work even :(

JurajB
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Fri Oct 02, 2015 3:28 pm

Re: jQuery and Bootstrap update

Post by JurajB » Sun Feb 16, 2020 10:05 am

I did it this way.

$doc = JFactory::getDocument();

$headData = $doc->getHeadData();
$scripts = $headData['scripts'];

unset($scripts[JUri::root(true) . '/media/jui/js/jquery.min.js']);
unset($scripts[JUri::root(true) . '/media/jui/js/jquery-noconflict.js']);
unset($scripts[JUri::root(true) . '/media/jui/js/bootstrap.min.js']);
unset($scripts[JUri::root(true) . '/media/jui/js/jquery-migrate.min.js']);

$headData['scripts'] = $scripts;
$doc->setHeadData($headData);

Is it OK? Now template loading 341.

JurajB
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Fri Oct 02, 2015 3:28 pm

Re: jQuery and Bootstrap update

Post by JurajB » Tue Feb 25, 2020 11:45 am

it was working but now wappalyzer dont show bootstrap version I think its maybe 2 then
also jquery migrate is loading what is what i dont want

 

Post Reply

Return to “General Questions/New to Joomla! 3.x”