How to remove jquery.autocomplete.min.js?

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
Locked
lip420
Joomla! Guru
Joomla! Guru
Posts: 510
Joined: Thu Feb 17, 2011 6:13 am

How to remove jquery.autocomplete.min.js?

Post by lip420 » Sat Mar 17, 2018 5:36 pm

Hi~
Trying to make my template faster by working on this:

Eliminate render-blocking JavaScript and CSS in above-the-fold content
  • jquery.autocomplete.min.js
    bootstrap.min.js
    jquery.min.js
Any ideas?

I tried a plug in for async and defer and unset, but unset or the plug in didn't work for this file...

Code: Select all

unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.autocomplete.min.js']);

deleted user

Re: How to remove jquery.autocomplete.min.js?

Post by deleted user » Sat Mar 17, 2018 11:12 pm

1) Core enqueues media with relative paths, so unsetting an absolute URL won't work

2) Instead of blindly removing media, you should understand what caused it to be loaded first to understand what capabilities you may be breaking by unloading a requested asset

3) In core, there are only two places where the autocomplete script is loaded; the Smart Search results page and the Smart Search module, both of which require this script to make the autocomplete suggestion functionality work, and both of which have an option to disable this feature from the backend (check either the menu item for your search results or the module's configuration). If you don't want the autocomplete script to load, then turn off the feature in the backend, this will prevent there being other JavaScript errors on your site because other script declarations are relying on the autocomplete script to be loaded.

lip420
Joomla! Guru
Joomla! Guru
Posts: 510
Joined: Thu Feb 17, 2011 6:13 am

Re: How to remove jquery.autocomplete.min.js?

Post by lip420 » Sun Mar 18, 2018 12:43 am

I see it's in the module setting. I got rid of one.


Locked

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